Refer to the tsc documentation if you want to make modifications. These are the important bits in the tsc config the rest is optional. Be sure to change them accordingly if you change that. outDir is used by the scripts in the bin folder.You can change lib to whatever you want, or even add more if you want.rootDir baseUrl and paths: Allows replacing import references with an absolute path.commonjs fails, so does es5, because of the generated tPorperty(exports. I did not test every possible value, but these seem to work. target and module: Set to generate 'raw' js to avoid any compatibility errors in NS.TypeScript compiler configuration ( tsconfig.json) webserver: runs the tiny webserver that will serve your scripts so that you can wget them from the game.copyResources: cps resources to build folder.buildManifest: runs the bin/generateManifest.bash to generate resources/manifest.txt file containing paths to all your scripts.buildNS: runs the bin/buildNS.bash script to convert.build: Runs everything necessary to build ts files into js and convert js files to ns before writing their paths to the resources/manifest.txt file."webserver": "node bin/webserver.js -p 9182 -d build -enable_cors " "re": "npm-run-all clean copyResources buildTs buildNS buildManifest ", "copyResources": "mkdir -p src/resources cp -r src/resources build ", "buildManifest": "bin/generateManifest.bash ", "build": "npm-run-all copyResources buildTs buildNS buildManifest ", DescriptionĪ short description of the most important parts of the template. You can leave the server running and just npm run re to clean rebuild the whole project, then use the pull alias in-game whenever you want to update your scripts. If you see the colored output until the fake error, you should be good to go :)Īfter the first pull, I usually make an alias alias pull="run /bin/utils/pullFiles.ns" to make things more convenient. You can also click Use as template in GitHub to create a repo form this one This has been tested on debian, WSL, and git-bash It's recommended to use a version manager like nvm.The template relies on a number of things that you can probably change to your liking just be aware you might need to fiddle with settings if you change them. This is a starter repo for anyone wanting to use TypeScript to play BitBurner!
0 Comments
Leave a Reply. |