Created
May 28, 2018 16:19
-
-
Save Pavel1104/d8a9ea3af5b595129493e08c87a39949 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