This commit is contained in:
apemanzilla
2017-11-26 13:49:53 -05:00
parent fb83e12a0b
commit 3d0359e89e
3 changed files with 42 additions and 9 deletions

View File

@@ -6,6 +6,16 @@ import commonjs from "rollup-plugin-commonjs";
import screeps from "rollup-plugin-screeps";
import typescript from "rollup-plugin-typescript2";
const config = require("./screeps");
let cfg;
const i = process.argv.indexOf("--dest") + 1;
if (i == 0) {
console.log("No destination specified - code will be compiled but not uploaded");
} else if (i >= process.argv.length || (cfg = config[process.argv[i]]) == null) {
throw new Error("Invalid upload destination");
}
export default {
input: "src/main.ts",
output: {
@@ -20,6 +30,6 @@ export default {
resolve(),
commonjs(),
typescript({tsconfig: "./tsconfig.json"}),
screeps({configFile: "./screeps.json"})
screeps({config: cfg, dryRun: cfg == null})
]
}