-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse.prod.js
55 lines (50 loc) · 1.08 KB
/
fuse.prod.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
54
55
const {
FuseBox,
WebIndexPlugin,
CSSPlugin,
SassPlugin,
BabelPlugin,
QuantumPlugin,
Sparky,
} = require('fuse-box');
const fuse = FuseBox.init({
homeDir: 'src/',
output: 'dist/$name.js',
hash: true,
cache: false,
sourceMaps: false,
plugins: [
[
SassPlugin(),
CSSPlugin({
outFile: file => `${__dirname}/dist/styles/main.css`,
}),
],
WebIndexPlugin({
template: 'src/public/index.template.html',
path: './',
}),
BabelPlugin({
presets: ['babel-preset-env'],
plugins: ['babel-plugin-inferno'],
}),
// QuantumPlugin({
// treeshake: true,
// uglify: true,
// bakeApiIntoBundle: 'app',
// }),
],
});
fuse.bundle('app').instructions('> index.js');
fuse.bundle('vendor').instructions('~ index.js');
Sparky.task('clean', () => {
return Sparky.src('dist/').clean('dist/');
});
Sparky.task('watch:images', () => {
return Sparky.src('**/*.+(svg|png|jpg|gif)', { base: './src' }).dest(
'./dist',
);
});
Sparky.task('default', ['clean', 'watch:images'], () => {
fuse.run();
});