-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse.js
46 lines (39 loc) · 896 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
const {
FuseBox,
WebIndexPlugin,
CSSPlugin,
SassPlugin,
BabelPlugin,
QuantumPlugin,
Sparky,
} = require('fuse-box');
let isProduction;
const fuse = FuseBox.init({
homeDir: 'src/',
output: 'dist/$name.js',
hash: isProduction,
cache: true,
sourceMaps: !isProduction,
plugins: [
[SassPlugin(), CSSPlugin()],
CSSPlugin(),
WebIndexPlugin({ template: 'public/index.template.html' }),
BabelPlugin({
presets: ['babel-preset-env'],
plugins: ['babel-plugin-inferno'],
}),
],
});
fuse.dev();
fuse.bundle('app').instructions('> index.js').watch().hmr();
Sparky.task('clean', () => {
return Sparky.src('dist/').clean('dist/');
});
Sparky.task('watch:images', () => {
return Sparky.watch('**/*.+(svg|png|jpg|gif)', { base: './src' }).dest(
'./dist',
);
});
Sparky.task('default', ['clean', 'watch:images'], () => {
fuse.run();
});