How to use the @angular-devkit/build-optimizer.buildOptimizer function in @angular-devkit/build-optimizer

To help you get started, we’ve selected a few @angular-devkit/build-optimizer 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 vyakymenko / angular-seed-express / tools / utils / seed / build_optimizer.ts View on Github external
return through.obj(function(file: any, encoding: any, callback: any) {
    if (file.isNull()) {
      // nothing to do
      return callback(null, file);
    }

    if (file.isBuffer()) {
      const res = buildOptimizer({
        content: file.contents.toString(),
        emitSourceMap: true
      });
      if (res.content) {
        file.contents = Buffer.from(res.content + inlineSourceMap(res.sourceMap), encoding);
      }
      return callback(null, file);
    }
  });
};
github steveblue / angular2-rollup / src / build / prod.js View on Github external
const buildOptimize = await ls(path.normalize('out-tsc/**/*.component.js')).forEach(function (file) {
        let content = fs.readFileSync(file, 'utf-8');
        fs.writeFileSync(file, buildOptimizer({ content: content }).content);
      });
github aelbore / angular-ivy-hello-world / rollup.config.js View on Github external
transform(content, id) {
      let isSideEffectFree = false;
      if(id.indexOf('node_modules/@angular') > -1 || id.indexOf('node_modules/rxjs') > -1){
        isSideEffectFree = true;
      }
      const { content: code, sourceMap: map } = buildOptimizer.buildOptimizer({
        content, inputFilePath: id, emitSourceMap: true, isSideEffectFree,
      });

      return { code, map };
	  }
	}
github steveblue / architect / build_tools / src / util.ts View on Github external
readFile(file, 'utf-8', (err, data) => {
            if (err) rej(err);
            writeFile(file, buildOptimizer({ content: data }).content, (err) => {
                if (err) rej(err);
                res(file);
            });
        });
        })

@angular-devkit/build-optimizer

Angular Build Optimizer

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis