Add rollup-plugin-screeps-upload to upload directly to screeps

This commit is contained in:
Adam Laycock
2017-11-21 20:28:24 +00:00
parent 4d6ebf3ec9
commit 80674295f1
5 changed files with 22 additions and 0 deletions

3
.gitignore vendored
View File

@@ -13,6 +13,9 @@
# TypeScript definitions installed by Typings # TypeScript definitions installed by Typings
/typings /typings
# Screeps Config
screeps.json
# Numerous always-ignore extensions # Numerous always-ignore extensions
*.diff *.diff
*.err *.err

View File

@@ -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! 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 ## 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. 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.

View File

@@ -21,6 +21,7 @@
"rollup": "^0.51.8", "rollup": "^0.51.8",
"rollup-plugin-commonjs": "^8.2.6", "rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-node-resolve": "^3.0.0", "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", "rollup-plugin-typescript2": "^0.8.1",
"tslint": "^5.8.0", "tslint": "^5.8.0",
"typed-screeps": "^1.0.4", "typed-screeps": "^1.0.4",

View File

@@ -2,6 +2,7 @@
import resolve from "rollup-plugin-node-resolve"; import resolve from "rollup-plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs"; import commonjs from "rollup-plugin-commonjs";
import screepsUpload from "rollup-plugin-screeps-upload";
import typescript from "rollup-plugin-typescript2"; import typescript from "rollup-plugin-typescript2";
// In Screeps, require only works for exported content // In Screeps, require only works for exported content
@@ -34,6 +35,7 @@ export default {
resolve(), resolve(),
commonjs(), commonjs(),
typescript({tsconfig: "./tsconfig.json"}), typescript({tsconfig: "./tsconfig.json"}),
screepsUpload('./screeps.json'),
exportSourceMaps() exportSourceMaps()
] ]
} }

8
screeps.sample.json Normal file
View File

@@ -0,0 +1,8 @@
{
"email": "you@provider.tld",
"password": "Password",
"protocol": "https",
"hostname": "screeps.com",
"port": 443,
"path": "/"
}