How to use the fuse-box/sparky.context 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 fuse-box / fuse-http / fuse.js View on Github external
});

task("dist", async context => {
    await context.clean();
    await context.prepareDistFolder();
    await context.dist("esnext", "es7");
    await context.dist("es6", "es6");
    await exec("tsc")
});

task("publish", async () => {
    await exec("dist")
    await npmPublish({path : "dist"});
})

context(class {
    getConfig() {
        return FuseBox.init({
            homeDir: "src",
            globals: { 'default': '*' }, // we need to expore index in our bundles
            target: this.target,
            output: "dist/$name.js",
            cache: !this.isProduction,
            plugins: [!this.isProduction && WebIndexPlugin(),
                this.isProduction && QuantumPlugin({
                    containedAPI: true,
                    ensureES5: false,
                    target: this.quantumTarget,
                    uglify: true,
                    bakeApiIntoBundle: this.bundleName
                })
            ]
github fuse-box / fuse-react / fuse.js View on Github external
task("test", async context => {
	await context.test();
});
task("dist", async context => {
	await context.clean();
	await exec("tsc");
});

task("publish", async context => {
	await exec("dist");
	await context.prepareDistFolder();
	await npmPublish({ path: "dist" });
});

context(
	class {
		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"
					})
				]
			});
		}
github troysandal / p5js-typescript-fusebox / fuse.js View on Github external
const { execSync } = require('child_process')
const { src, task, context } = require("fuse-box/sparky")
const {
  FuseBox,
  WebIndexPlugin,
  CopyPlugin,
  QuantumPlugin
} = require('fuse-box')

context(class {
  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,
github fuse-box / react-example / fuse.js View on Github external
const { FuseBox, Sparky, WebIndexPlugin, SVGPlugin, CSSPlugin, QuantumPlugin } = require("fuse-box");
const { src, task, watch, context, fuse } = require("fuse-box/sparky");


context(class {
    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,
github SassNinja / postcss-extract-media-query / examples / fuse-box / fuse.js View on Github external
const extractMediaQuery = require('postcss-extract-media-query');
const extractMediaQueryConfig = require('./postcss.config').plugins['postcss-extract-media-query'];

const { FuseBox, PostCSSPlugin, CSSPlugin } = require('fuse-box');
const { src, task, exec, context } = require('fuse-box/sparky');

context(class {
    getConfig() {
        return FuseBox.init({
            homeDir: 'src',
            output: 'dist/$name.js',
            target: 'browser@es2015',
            ensureTsConfig: false,
            plugins: [
                [
                    PostCSSPlugin([
                        extractMediaQuery(extractMediaQueryConfig)
                    ]),
                    CSSPlugin({
                        outFile: (file) => `dist/${file}`
                    })
                ]
            ]