Skip to content

Instantly share code, notes, and snippets.

@kasper573
Last active December 7, 2017 05:34
Show Gist options
  • Save kasper573/2cee71984e7d378a88d69e76d1b73aaf to your computer and use it in GitHub Desktop.
Save kasper573/2cee71984e7d378a88d69e76d1b73aaf to your computer and use it in GitHub Desktop.
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