Created
January 26, 2018 02:33
-
-
Save gmlnchv/afef68616a96289907ac5b9ecdfc0b3a 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, | |
QuantumPlugin, | |
SassPlugin, | |
CSSPlugin, | |
Sparky | |
} from "fuse-box"; | |
let fuse, app, isProduction; | |
Sparky.task("config", () => { | |
fuse = new FuseBox({ | |
homeDir: "src", | |
target: "browser@es6", | |
hash: false, | |
sourceMaps: !isProduction, | |
output: "dist/$name.js", | |
useTypescriptCompiler: true, | |
plugins: [ | |
[SassPlugin(), CSSPlugin()], | |
isProduction && | |
QuantumPlugin({ | |
bakeApiIntoBundle: "app", | |
uglify: true | |
}) | |
] | |
}); | |
app = fuse.bundle("app").instructions("> index.js"); | |
}); | |
Sparky.task("default", ["clean", "config"], () => { | |
fuse.dev({ open: false }); | |
app.watch().hmr(); | |
return fuse.run(); | |
}); | |
Sparky.task("clean", () => Sparky.src("dist").clean("dist/")); | |
Sparky.task("prod-env", ["clean"], () => { | |
isProduction = true; | |
}); | |
Sparky.task("dist", ["prod-env", "config"], () => { | |
return fuse.run(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment