Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fsbx = require("fuse-box");
const gulp = require("gulp");
const runSequence = require('run-sequence');
const server = require('gulp-server-livereload');
// Create FuseBox Instance
let fuseBox = new fsbx.FuseBox({
homeDir: "src/",
sourceMap: {
bundleReference: "sourcemaps.js.map",
outFile: "./build/sourcemaps.js.map",
},
outFile: "./build/out.js",
plugins: [
fsbx.SVGPlugin(),
fsbx.CSSPlugin(),
fsbx.BabelPlugin({
config: {
sourceMaps: true,
presets: ["latest"],
plugins: [
["transform-react-jsx"]
Sparky.task('config', () => {
fuse = new FuseBox({
homeDir: srcDir,
sourceMaps: isProduction ? false : { project: true, vendor: false },
hash: isProduction && !component && !componentdocs,
cache: !isProduction,
output: path.join(
targetDir,
componentdocs ? paths.Bundle : '',
'$name.js'
),
target: isProduction ? 'browser@es5' : 'browser@es2015',
plugins: [
EnvPlugin(env),
SVGPlugin(),
/* [LESSPlugin(), CSSPlugin()], Add LESS, SASS, etc here if needed */
CSSPlugin(),
JSONPlugin(),
Sparky.task('config', () => {
fuse = new FuseBox({
homeDir: srcDir,
sourceMaps: isProduction ? false : { project: true, vendor: false },
hash: isProduction && !component && !componentdocs,
cache: !isProduction,
output: path.join(
targetDir,
componentdocs ? paths.Bundle : '',
'$name.js'
),
target: isProduction ? 'browser@es5' : 'browser@es2015',
plugins: [
EnvPlugin(env),
SVGPlugin(),
/* [LESSPlugin(), CSSPlugin()], Add LESS, SASS, etc here if needed */
CSSPlugin(),
JSONPlugin(),
module.exports = production => {
const output = production ? 'dist' : 'build'
const fuse = new FuseBox({
homeDir: 'client',
sourceMaps: !production,
hash: production,
output: `${output}/$name.js`,
plugins: [
['.json', JSONPlugin()],
['.scss', SassPlugin(), CSSPlugin({outFile: `${output}/app.css`, group: 'app.css'})],
['.js', ESLintPlugin(), BabelPlugin()],
WebIndexPlugin({
title: 'Docker UI',
template: 'client/index.html'
}),
],
alias: {
stores: '~/stores',
lib: '~/lib',
Sparky.task('config', _ => {
fuse = new FuseBox({
homeDir: 'src',
hash: isProduction,
output: 'dist/$name.js',
cache: !isProduction,
sourceMaps: !isProduction,
target: 'browser',
plugins: [
EnvPlugin({ NODE_ENV: isProduction ? 'production' : 'development' }),
WebIndexPlugin({
title: 'React Typescript FuseBox Example',
template: 'src/index.html',
}),
isProduction &&
QuantumPlugin({
bakeApiIntoBundle: 'app',
treeshake: true,
}
}
var worker = new WebWorkerPlugin()
worker.test = /(.*)/
var params = {
debug: true,
cache: false,
homeDir: resolve('./'),
outFile: resolve('./src/webworker/dist/ww.js'),
plugins: [
worker,
],
}
var fuse = new fsbx.FuseBox(params)
fuse.bundle('>/src/webworker/index.js src/**/webworker/*.js')
Sparky.task('config', _ => {
fuse = new FuseBox({
homeDir: 'src',
hash: isProduction,
output: 'dist/$name.js',
cache: !isProduction,
sourceMaps: !isProduction,
target: 'browser',
transformers: {
before: [transformInferno()],
},
plugins: [
EnvPlugin({ NODE_ENV: isProduction ? 'production' : 'development' }),
WebIndexPlugin({
title: 'Inferno Typescript FuseBox Example',
template: 'src/index.html',
}),
isProduction &&