3 changed files with 268 additions and 7752 deletions
-
125fuse.js
-
7package.json
-
7888yarn.lock
@ -1,61 +1,66 @@ |
|||
const { |
|||
FuseBox, |
|||
Sparky, |
|||
EnvPlugin, |
|||
CSSPlugin, |
|||
WebIndexPlugin, |
|||
QuantumPlugin, |
|||
} = require('fuse-box'); |
|||
const transformInferno = require('ts-transform-inferno').default; |
|||
const transformClasscat = require('ts-transform-classcat').default; |
|||
let fuse, app; |
|||
let isProduction = false; |
|||
/** |
|||
* FUSEBOX IS NO LONGER USED FOR THIS PROJECT |
|||
* Keeping this as a reference for now in case there are problems with the new bundler down the road |
|||
*/ |
|||
|
|||
Sparky.task('config', _ => { |
|||
fuse = new FuseBox({ |
|||
homeDir: 'src', |
|||
hash: isProduction, |
|||
output: 'dist/$name.js', |
|||
experimentalFeatures: true, |
|||
cache: !isProduction, |
|||
// sourceMaps: !isProduction,
|
|||
sourceMaps: true, |
|||
transformers: { |
|||
before: [transformClasscat(), transformInferno()], |
|||
}, |
|||
alias: { |
|||
locale: 'moment/locale', |
|||
}, |
|||
plugins: [ |
|||
EnvPlugin({ NODE_ENV: isProduction ? 'production' : 'development' }), |
|||
CSSPlugin(), |
|||
WebIndexPlugin({ |
|||
title: 'Inferno Typescript FuseBox Example', |
|||
template: 'src/index.html', |
|||
path: isProduction ? '/static' : '/', |
|||
}), |
|||
isProduction && |
|||
QuantumPlugin({ |
|||
bakeApiIntoBundle: 'app', |
|||
treeshake: true, |
|||
uglify: true, |
|||
}), |
|||
], |
|||
}); |
|||
app = fuse.bundle('app').instructions('>index.tsx'); |
|||
}); |
|||
Sparky.task('clean', _ => Sparky.src('dist/').clean('dist/')); |
|||
Sparky.task('env', _ => (isProduction = true)); |
|||
Sparky.task('copy-assets', () => |
|||
Sparky.src('assets/**/**.*').dest(isProduction ? 'dist/' : 'dist/static') |
|||
); |
|||
Sparky.task('dev', ['clean', 'config', 'copy-assets'], _ => { |
|||
fuse.dev({ |
|||
fallback: 'index.html', |
|||
}); |
|||
app.hmr().watch(); |
|||
return fuse.run(); |
|||
}); |
|||
Sparky.task('prod', ['clean', 'env', 'config', 'copy-assets'], _ => { |
|||
return fuse.run(); |
|||
}); |
|||
// const {
|
|||
// FuseBox,
|
|||
// Sparky,
|
|||
// EnvPlugin,
|
|||
// CSSPlugin,
|
|||
// WebIndexPlugin,
|
|||
// QuantumPlugin,
|
|||
// } = require('fuse-box');
|
|||
// const transformInferno = require('ts-transform-inferno').default;
|
|||
// const transformClasscat = require('ts-transform-classcat').default;
|
|||
// let fuse, app;
|
|||
// let isProduction = false;
|
|||
|
|||
// Sparky.task('config', _ => {
|
|||
// fuse = new FuseBox({
|
|||
// homeDir: 'src',
|
|||
// hash: isProduction,
|
|||
// output: 'dist/$name.js',
|
|||
// experimentalFeatures: true,
|
|||
// cache: !isProduction,
|
|||
// // sourceMaps: !isProduction,
|
|||
// sourceMaps: true,
|
|||
// transformers: {
|
|||
// before: [transformClasscat(), transformInferno()],
|
|||
// },
|
|||
// alias: {
|
|||
// locale: 'moment/locale',
|
|||
// },
|
|||
// plugins: [
|
|||
// EnvPlugin({ NODE_ENV: isProduction ? 'production' : 'development' }),
|
|||
// CSSPlugin(),
|
|||
// WebIndexPlugin({
|
|||
// title: 'Inferno Typescript FuseBox Example',
|
|||
// template: 'src/index.html',
|
|||
// path: isProduction ? '/static' : '/',
|
|||
// }),
|
|||
// isProduction &&
|
|||
// QuantumPlugin({
|
|||
// bakeApiIntoBundle: 'app',
|
|||
// treeshake: true,
|
|||
// uglify: true,
|
|||
// }),
|
|||
// ],
|
|||
// });
|
|||
// app = fuse.bundle('app').instructions('>index.tsx');
|
|||
// });
|
|||
// Sparky.task('clean', _ => Sparky.src('dist/').clean('dist/'));
|
|||
// Sparky.task('env', _ => (isProduction = true));
|
|||
// Sparky.task('copy-assets', () =>
|
|||
// Sparky.src('assets/**/**.*').dest(isProduction ? 'dist/' : 'dist/static')
|
|||
// );
|
|||
// Sparky.task('dev', ['clean', 'config', 'copy-assets'], _ => {
|
|||
// fuse.dev({
|
|||
// fallback: 'index.html',
|
|||
// });
|
|||
// app.hmr().watch();
|
|||
// return fuse.run();
|
|||
// });
|
|||
// Sparky.task('prod', ['clean', 'env', 'config', 'copy-assets'], _ => {
|
|||
// return fuse.run();
|
|||
// });
|
7888
yarn.lock
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue