How to use the fuse-box.CopyPlugin function in fuse-box

To help you get started, we’ve selected a few fuse-box examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skellock / typescript-with-electron-react-kit / fuse.ts View on Github external
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)
github troysandal / p5js-typescript-fusebox / fuse.js View on Github external
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"
        })
      ]
    })
  }
github wexond / desktop / fuse.js View on Github external
const getCopyPlugin = () => {
  return CopyPlugin({
    files: ['*.woff2', '*.png', '*.svg'],
    dest: 'assets',
    resolve: production ? './assets' : '/assets',
  });
};
github dot-browser / desktop / fuse.js View on Github external
const getCopyPlugin = () => {
  return CopyPlugin({
    files: ['*.woff2', '*.png', '*.svg'],
    dest: 'assets',
    resolve: production ? './assets' : '/assets',
  });
};
github FlorianRappl / Mario5TS / fuse.js View on Github external
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;
}
github sentialx / multrin / fuse.js View on Github external
const getCopyPlugin = () => {
  return CopyPlugin({
    files: ['*.woff2', '*.png', '*.svg'],
    dest: 'assets',
    resolve: production ? './assets' : '/assets',
  });
};