-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfuse.js
53 lines (49 loc) · 973 Bytes
/
fuse.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const {
FuseBox,
WebIndexPlugin,
CSSResourcePlugin,
CSSPlugin,
QuantumPlugin,
RawPlugin,
CopyPlugin,
} = require("fuse-box");
let isProduction = false;
if (process.env.NODE_ENV === "production") {
isProduction = true;
}
const fuse = FuseBox.init({
homeDir: "src",
target: "browser@es6",
output: "dist/$name.js",
hash: isProduction,
plugins: [
WebIndexPlugin({
template: "index.template.html",
pre: { relType: "load" },
}),
[
CSSResourcePlugin({
inline: true,
}),
CSSPlugin(),
],
RawPlugin(["maps/*.svg"]),
CopyPlugin({
files: ["tracks/*.xm"],
}),
isProduction &&
QuantumPlugin({
uglify: true,
treeshake: true,
bakeApiIntoBundle: "app",
}),
],
});
if (!isProduction) {
fuse.dev(); // launch http server
}
const bundle = fuse.bundle("app").instructions(" > index.tsx");
if (!isProduction) {
bundle.hmr().watch();
}
fuse.run();