How to use the fuse-box.Sparky.watch 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 OffGridNetworks / fuse-box-create-react-app / packages / fuse-box-react-scripts-ts / config / fuse.config.js View on Github external
Sparky.task('static', () => {
    const watchPaths = Array.isArray(staticDirs)
      ? staticDirs.map(pathPublic => pathPublic + '/**/*')
      : staticDirs + '/**/*';

    const publicArray = Array.isArray(staticDirs) ? staticDirs : [staticDirs];

    return Sparky.watch(watchPaths).file(``, file => {
      let root = publicArray.find(
        element => file.root.substr(0, element.length) == element
      );
      let relativePath = root ? path.relative(root, file.root) : '';
      file.copy(path.join(targetDir, relativePath));
    });
  });
github patrickmichalina / fusebox-angular-universal-starter / tools / tasks / seed / sass.ts View on Github external
const transformer = new ConfigurationTransformer();
    const html = transformer.applyTransform([{
      inHead: true,
      order: 1,
      element: 'style',
      content: new cleanCss({}).minify(_sass.css.toString()).styles,
      attributes: {
        id: 'primary-styles'
      }
    }], index.toString());
    writeFileSync(indexPath, html);
  }

  src = isProdBuild || isBuildServer
    ? Sparky.src('src/client/styles/**/**/*.scss').file('main.scss', process)
    : Sparky.watch('src/client/styles/**/**/*.scss').file('main.scss', process)

  return src
})
github OffGridNetworks / fuse-box-create-react-app / packages / fuse-box-react-scripts / config / fuse.config.js View on Github external
Sparky.task('static', () => {
    const watchPaths = Array.isArray(staticDirs)
      ? staticDirs.map(pathPublic => pathPublic + '/**/*')
      : staticDirs + '/**/*';

    const publicArray = Array.isArray(staticDirs) ? staticDirs : [staticDirs];

    return Sparky.watch(watchPaths).file(``, file => {
      let root = publicArray.find(
        element => file.root.substr(0, element.length) == element
      );
      let relativePath = root ? path.relative(root, file.root) : '';
      file.copy(path.join(targetDir, relativePath));
    });
  });
github ujjwalguptaofficial / idbstudio / src / fuse.config.js View on Github external
Sparky.task("watch-assets", () => Sparky.watch("./assets", {
  base: "./code"
}).dest("./dist"));
Sparky.task("copy-assets", () => Sparky.src("./assets", {
github Jack85 / vue-ts-ex / fuse.js View on Github external
Sparky.task("watch-assets", () => Sparky.watch("./assets", { base: "./src" }).dest("./dist"));
Sparky.task("copy-assets", () => Sparky.src("./assets", { base: "./src" }).dest("./dist"));