Created
February 13, 2017 00:34
-
-
Save basarat/169f735c898ffa651915763907d1bd24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { FuseBox } = require('fuse-box'); | |
const fsbx = require('fuse-box'); | |
const box = FuseBox | |
.init({ | |
tsConfig: "tsconfig.json", | |
homeDir: "src/", | |
sourceMap: { | |
bundleReference: "sourcemaps.js.map", | |
outFile: "public/build/sourcemaps.js.map", | |
}, | |
outFile: "public/build/bundle.js", | |
plugins: [ | |
fsbx.EnvPlugin({ NODE_ENV: process.argv[2] }), | |
!process.argv.includes('dev') && fsbx.UglifyJSPlugin() | |
] | |
}) | |
if (process.argv.includes('dev')){ | |
box.devServer('>app.tsx', { | |
port: 9966, | |
root : './public' | |
}) | |
} | |
else { | |
box.bundle('>app.tsx') | |
} | |
/// Usage | |
// node fuse dev | |
// node fuse production | |
// node fuse test | |
// etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment