Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ReplacePlugin({
"process.env.HOMEPAGE": pjson.homepage ? `"${pjson.homepage}"` : "null",
}),
)
// and watch unless we're bundling for production
if (!isProduction) {
mainBundle.watch()
}
// bundle the electron renderer code
const rendererBundle = fuse
.bundle("renderer")
.instructions("> [app/index.tsx] +fuse-box-css")
.plugin(CSSPlugin())
.plugin(CopyPlugin({ useDefault: false, files: ASSETS, dest: "assets", resolve: "assets/" }))
// and watch & hot reload unless we're bundling for production
if (!isProduction) {
rendererBundle.watch()
rendererBundle.hmr()
}
// when we are finished bundling...
return fuse.run().then(() => {
if (!isProduction) {
// startup electron
spawn("node", [`${__dirname}/node_modules/electron/cli.js`, __dirname], {
stdio: "inherit",
}).on("exit", code => {
console.log(`electron process exited with code ${code}`)
process.exit(code)
getConfig() {
return FuseBox.init({
homeDir: 'src',
output: 'dist/$name.js',
target : 'browser@es5',
sourceMaps: !this.isProduction,
globals: !this.isProduction ? { p5: 'p5' } : {},
plugins: [
WebIndexPlugin(),
CopyPlugin({
files: ['.mp3', '.wav', '.vlw', '.ttf']
}),
this.isProduction && QuantumPlugin({
uglify: false,
ensureES5: true,
treeshake : true,
bakeApiIntoBundle: "app"
})
]
})
}
const getCopyPlugin = () => {
return CopyPlugin({
files: ['*.woff2', '*.png', '*.svg'],
dest: 'assets',
resolve: production ? './assets' : '/assets',
});
};
const getCopyPlugin = () => {
return CopyPlugin({
files: ['*.woff2', '*.png', '*.svg'],
dest: 'assets',
resolve: production ? './assets' : '/assets',
});
};
function CopyAllPlugin(options) {
const copy = CopyPlugin(options);
const original = copy.transform;
copy.transform = file => {
file.context.hash = true;
return original.call(copy, file);
};
return copy;
}
const getCopyPlugin = () => {
return CopyPlugin({
files: ['*.woff2', '*.png', '*.svg'],
dest: 'assets',
resolve: production ? './assets' : '/assets',
});
};