Skip to content

Instantly share code, notes, and snippets.

@Pavel1104
Created May 28, 2018 16:19
Show Gist options
  • Save Pavel1104/d8a9ea3af5b595129493e08c87a39949 to your computer and use it in GitHub Desktop.
Save Pavel1104/d8a9ea3af5b595129493e08c87a39949 to your computer and use it in GitHub Desktop.
fusebox settings
const { FuseBox, WebIndexPlugin, StylusPlugin, CSSPlugin, EnvPlugin, QuantumPlugin } = require("fuse-box");
const isProduction = process.env.NODE_ENV === "production"
let fuse = FuseBox.init({
homeDir : "src",
target : 'browser@es5',
output : "dist/$name.js",
plugins : [
[StylusPlugin(), CSSPlugin()],
WebIndexPlugin({
template : "src/index.html"
}),
isProduction && EnvPlugin({
NODE_ENV: process.env.NODE_ENV
}),
isProduction && QuantumPlugin({
bakeApiIntoBundle: "app",
// replaceProcessEnv: true,
treeshake: true,
uglify: true,
})
]
})
if (isProduction) {
fuse.bundle("app").instructions("> index.tsx")
} else {
fuse.dev({open: false})
fuse.bundle("app").instructions("> index.tsx").hmr().watch()
}
fuse.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment