How to use the fuse-box.CSSPlugin 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
.plugin(
      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}`)
github bkniffler / debe / example / todo / fuse.ts View on Github external
// start the hot reload server
  if (!isProduction) {
    fuse.dev({
      fallback: '../src/index.html',
      port: DEV_PORT
    });
  }

  // bundle the electron renderer code
  const browser = fuse
    .bundle('browser')
    .target('browser@esnext')
    .instructions('> example/todo/src/index.tsx')
    .plugin(JSONPlugin())
    .plugin(WebIndexPlugin({ template: './src/index.html' }))
    .plugin(CSSPlugin({ inject: true }))
    .plugin(
      ReplacePlugin({
        'process.env.NODE_ENV': `${process.env.NODE_ENV}`
      })
    );

  const server = fuse
    .bundle('server')
    .target('server@esnext')
    .instructions('> example/todo/server/index.ts -better-sqlite3');

  if (!isProduction) {
    server.watch(
      p =>
        p.indexOf(`/debe/src/`) !== -1 ||
        p.indexOf(resolve(__dirname, 'server')) === 0
github fuse-box / react-example / fuse.js View on Github external
getConfig() {
        return FuseBox.init({
            homeDir: "src",
            output: "dist/$name.js",
            target : "browser@es5",
            hash: this.isProduction,
            useTypescriptCompiler : true,
            plugins: [
                CSSPlugin(),
                SVGPlugin(),
                WebIndexPlugin({
                    template : "src/index.html"
                }),
                this.isProduction && QuantumPlugin({
                    bakeApiIntoBundle: "app",
                    uglify: true,
                    css : true
                })
            ]
        })
    }
    createBundle(fuse) {
github fuse-box / fuse-react / fuse.js View on Github external
getConfig() {
			return FuseBox.init({
				homeDir: "src",
				target: "browser@es5",
				output: "dist/$name.js",
				plugins: [
					[SassPlugin(), CSSPlugin()],
					WebIndexPlugin({
						template: "src/index.html",
						path: "/static"
						//resolve  : "/static"
					})
				]
			});
		}
		async tsc() {
github SassNinja / postcss-extract-media-query / examples / fuse-box / fuse.js View on Github external
getConfig() {
        return FuseBox.init({
            homeDir: 'src',
            output: 'dist/$name.js',
            target: 'browser@es2015',
            ensureTsConfig: false,
            plugins: [
                [
                    PostCSSPlugin([
                        extractMediaQuery(extractMediaQueryConfig)
                    ]),
                    CSSPlugin({
                        outFile: (file) => `dist/${file}`
                    })
                ]
            ]
        });
    }
});