How to use the fuse-box.Sparky.src 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
Sparky.task("copy-html", () => {
  return Sparky.src("src/app/index.html").dest(`${OUTPUT_DIR}/$name`)
})
github WorkSight / rewire / fuse-build.js View on Github external
Sparky.task('copy-pkg', (context) => Sparky.src('./package.json', { base: `./packages/${context.pkg}` }).dest(`./packages/${context.pkg}/dist/`));
Sparky.task('copy-md',  (context) => Sparky.src('./*.md', { base: `./packages/${context.pkg}` }).dest(`./packages/${context.pkg}/dist/`));
github patrickmichalina / fusing-angular-v1-archived / tools / tasks / seed / tmp-ng6-upgrade.ts View on Github external
Sparky.task('jest.zone.fix', () =>
  Sparky.src('node_modules/jest-preset-angular/**').file(
    'setupJest.js',
    (file: SparkyFile) => {
      file.read()
      const text = (file.contents as Buffer).toString()
      const regex = new RegExp(/require\('zone.js\/dist\/zone.js'\);/, 'g')
      const replacedText = text.replace(regex, "require('zone.js');")
      file.setContent(replacedText)
      file.save()
    }
  )
)
github patrickmichalina / fusebox-angular-universal-starter / tools / tasks / seed / sass.files.ts View on Github external
Sparky.task(taskName(__filename), () => {
  const css = glob('./dist/css/**/*.css').map(a => {
    return {
      hash: hash(readFileSync(a).toString()),
      name: a.replace('./dist', '')
    }
  })

  return Sparky.src('./dist/index.html').file('index.html', (file: SparkyFile) => {
    file.read()

    const transformer = new ConfigurationTransformer()
    const deps: Dependency[] = css.map(c => {
      return {
        inHead: true,
        order: 1,
        element: 'link',
        attributes: {
          rel: 'stylesheet',
          href: `${c.name}`
        }
      } as Dependency
    })

    const html = transformer.applyTransform(deps, file.contents.toString())
github patrickmichalina / fusing-angular-v1-archived / tools / tasks / seed / ngsw-worker.min.ts View on Github external
Sparky.task(taskName(__filename), () => {
  return Sparky.src(['./dist/ngsw-worker.js']).file(
    'ngsw-worker.js',
    (file: SparkyFile) => {
      file.read()
      const result = uglifyJS.minify(file.contents.toString())
      file.setContent(result.code)
      file.save()
    }
  )
})
github nick121212 / fx-schema-form / packages / fx-schema-form-react / fuse.js View on Github external
Sparky.task("clean", () => Sparky.src("out/").clean("out/"));
github deamme / laco / examples / react / fuse.js View on Github external
Sparky.task('clean', _ => Sparky.src('dist/').clean('dist/'))
Sparky.task('env', _ => (isProduction = true))
github patrickmichalina / fusebox-angular-universal-starter / tools / tasks / seed / web.ts View on Github external
Sparky.task(taskName(__filename), () =>
  Sparky.src('web/**/*.*', { base: `${BUILD_CONFIG.toolsDir}` })
    .dest(`./${BUILD_CONFIG.outputDir}`))
github patrickmichalina / fusebox-angular-universal-starter / tools / tasks / seed / clean.ts View on Github external
Sparky.task(taskName(__filename), () =>
  Sparky.src(`${BUILD_CONFIG.outputDir}`)
    .clean(`${BUILD_CONFIG.outputDir}`)
    .clean('.fusebox')
    .clean('.ngc')
    .clean('src/client/.aot'))
github WorkSight / rewire / fuse-build.js View on Github external
async function build(context, pkg, targets) {
  context.pkg        = pkg;
  await Sparky.exec('copy-src', 'copy-pkg', 'copy-md');
  await Sparky.src(`./packages/${context.pkg}/dist/*.json`).file('package.json', (file) => {
    file.json(json => {
      json.typings    = './index.ts';
      json['ts:main'] = './index.ts';
    });
    file.save();
  }).exec();
  for (const target of targets) {
    context.bundleName = `${target}-lib`;
    context.home       = `./packages/${pkg}/dist/`;
    context.target     = `browser@${target}`;
    await Sparky.resolve('config');
    await fuse.run();
  }
}