Last active
December 7, 2017 05:34
-
-
Save kasper573/2cee71984e7d378a88d69e76d1b73aaf to your computer and use it in GitHub Desktop.
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
import {FuseBox, EnvPlugin, QuantumPlugin, WebIndexPlugin, CopyPlugin, CSSPlugin, ImageBase64Plugin} from "fuse-box"; | |
const isProduction: boolean = false; | |
const fuse = FuseBox.init({ | |
homeDir: "src", | |
sourceMaps: isProduction ? undefined : {project: true, vendor: false}, | |
hash: isProduction, | |
target: "browser@es2015", | |
output: "dist/$name.js", | |
alias: { | |
"src": "~/" | |
}, | |
warnings: true, | |
cache: !isProduction, | |
log: !isProduction, | |
debug: !isProduction, | |
tsConfig: "tsconfig.json", | |
useTypescriptCompiler: true, | |
plugins: [ | |
EnvPlugin({ NODE_ENV: isProduction ? "production" : "development" }), | |
WebIndexPlugin({title: "Dankest Dungeon", path: "."}), | |
CSSPlugin(), | |
CopyPlugin({files: ["*.png", "*.jpg", "*.ogg"], dest: "assets"}), | |
isProduction ? | |
QuantumPlugin({ | |
treeshake: true, | |
uglify: true | |
}) : undefined | |
] | |
}); | |
fuse.bundle("vendor") | |
.instructions(`~ polyfills/index.js`) | |
.instructions(`~ main.tsx`); | |
const app = fuse.bundle("app") | |
.watch() | |
.instructions(`!> [main.tsx]`); | |
fuse.dev(); | |
app.hmr(); | |
fuse.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment