Skip to content

Instantly share code, notes, and snippets.

@CGamesPlay
Created January 23, 2017 20:04
Show Gist options
  • Save CGamesPlay/11c68c6266efa87e2a32b2a23a88cd69 to your computer and use it in GitHub Desktop.
Save CGamesPlay/11c68c6266efa87e2a32b2a23a88cd69 to your computer and use it in GitHub Desktop.
Screeps grunt / webpack config
{
plugins: [ 'transform-flow-strip-types' ]
}
const config = require('./screeps-multimeter');
const webpack_config = require('./webpack.config');
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-screeps');
grunt.initConfig({
webpack: {
default: webpack_config
},
screeps: {
options: {
email: config.email,
password: config.password,
branch: grunt.option('branch') || 'default',
ptr: false
},
dist: {
src: ['dist/*.js']
}
}
});
grunt.registerTask('default', ['webpack:default', 'screeps']);
}
{
"name": "screeps",
"version": "1.0.0",
"description": "",
"main": "src/main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Ryan Patterson <ry@cgamesplay.com> (http://cgamesplay.com/)",
"license": "ISC",
"dependencies": {
"babel-core": "^6.20.0",
"babel-loader": "^6.2.9",
"babel-plugin-transform-flow-strip-types": "^6.18.0",
"grunt": "^1.0.1",
"grunt-screeps": "^1.2.1",
"grunt-webpack": "^1.0.18",
"screeps-profiler": "^1.2.2",
"webpack": "^1.13.3",
"lodash": "3.10.1"
},
"devDependencies": {
"screeps-api": "^0.2.8"
}
}
const path = require('path');
module.exports = {
entry: "./src/main.js",
output: {
path: path.join(__dirname, "dist"),
filename: "main.js",
library: "main",
libraryTarget: "commonjs2"
},
externals: {
lodash: "lodash"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
}
]
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment