-
-
Save sigerello/eb9abbb6bd9b64dfe6e0f6d737691f9a to your computer and use it in GitHub Desktop.
fusebox settings
This file contains 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, 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