Skip to content

Instantly share code, notes, and snippets.

@CHH
Created January 5, 2017 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CHH/1c3fe5ebe89651d4886a0820b8e3c025 to your computer and use it in GitHub Desktop.
Save CHH/1c3fe5ebe89651d4886a0820b8e3c025 to your computer and use it in GitHub Desktop.
const {run} = require('runjs')
const fractal = require('./frontend/fractal.js')
const task = {
'build': () => {
task['webpack:build']()
task['fractal:build']()
},
'watch': () => {
task['webpack:watch']()
task['fractal:watch']()
},
'webpack:build': () => {
run(`NODE_ENV=production parallel-webpack --config=./parallel.webpack.config.js --max-retries=1`)
},
'webpack:watch': () => {
run(`parallel-webpack --no-stats --config=./parallel.webpack.config.js -p=2 --watch`, {async: true})
},
'fractal:build': () => {
const builder = fractal.web.builder()
builder.build().then(() => {
console.log("fractal build complete")
})
},
'fractal:watch': () => {
const server = fractal.web.server({
sync: true,
})
server.start()
}
}
module.exports = task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment