diff --git a/.gitignore b/.gitignore index 67c701b..1db149c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,9 @@ # TypeScript definitions installed by Typings /typings +# Screeps Config +screeps.json + # Numerous always-ignore extensions *.diff *.err diff --git a/README.md b/README.md index 24a8783..cd0e581 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,14 @@ Open the folder in your terminal and run `npm install` (or `yarn`) to install th Fire up your preferred editor with typescript installed and you are good to go! +### Rollup + +Screeps Typescript Starter uses rollup to compile your typescript and upload it to a screeps server. + +Change `creeps.sample.json` to `screeps.json` and update the settings. + +Running `rollup -c` will compile and upload your code. + ## Typings The typings for Screeps comes from [typed-screeps](https://github.com/screepers/typed-screeps), if you have an issue with incorrect typings open an issue there. diff --git a/package.json b/package.json index 8ae0861..e854112 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "rollup": "^0.51.8", "rollup-plugin-commonjs": "^8.2.6", "rollup-plugin-node-resolve": "^3.0.0", + "rollup-plugin-screeps-upload": "git+https://github.com/ezolenko/rollup-plugin-screeps-upload.git#master", "rollup-plugin-typescript2": "^0.8.1", "tslint": "^5.8.0", "typed-screeps": "^1.0.4", diff --git a/rollup.config.js b/rollup.config.js index d4138da..c52ea4c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,6 +2,7 @@ import resolve from "rollup-plugin-node-resolve"; import commonjs from "rollup-plugin-commonjs"; +import screepsUpload from "rollup-plugin-screeps-upload"; import typescript from "rollup-plugin-typescript2"; // In Screeps, require only works for exported content @@ -34,6 +35,7 @@ export default { resolve(), commonjs(), typescript({tsconfig: "./tsconfig.json"}), + screepsUpload('./screeps.json'), exportSourceMaps() ] } diff --git a/screeps.sample.json b/screeps.sample.json new file mode 100644 index 0000000..ef14e32 --- /dev/null +++ b/screeps.sample.json @@ -0,0 +1,8 @@ +{ + "email": "you@provider.tld", + "password": "Password", + "protocol": "https", + "hostname": "screeps.com", + "port": 443, + "path": "/" +}