How to use the @angular-devkit/build-optimizer.BuildOptimizerWebpackPlugin 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 nrwl / nx / packages / web / src / utils / third-party / cli-files / models / webpack-configs / common.ts View on Github external
}

  let sourceMapUseRule;
  if ((scriptsSourceMap || stylesSourceMap) && vendorSourceMap) {
    sourceMapUseRule = {
      use: [
        {
          loader: 'source-map-loader'
        }
      ]
    };
  }

  let buildOptimizerUseRule;
  if (buildOptions.buildOptimizer) {
    extraPlugins.push(new BuildOptimizerWebpackPlugin());
    buildOptimizerUseRule = {
      use: [
        {
          loader: buildOptimizerLoaderPath,
          options: { sourceMap: scriptsSourceMap }
        }
      ]
    };
  }

  // Allow loaders to be in a node_modules nested inside the devkit/build-angular package.
  // This is important in case loaders do not get hoisted.
  // If this file moves to another location, alter potentialNodeModules as well.
  const loaderNodeModules = findAllNodeModules(__dirname, projectRoot);
  loaderNodeModules.unshift('node_modules');
github ng-qt / ng-qt / packages / devkit / src / utils / config.ts View on Github external
new CircularDependencyPlugin({
        exclude: /[\\\/]node_modules[\\\/]/,
      }),
    );
  }

  if (options.optimization) {
    webpackConfig.module.rules.push({
      test: /\.js$/,
      loader: '@angular-devkit/build-optimizer/webpack-loader',
      options: {
        sourceMap: options.sourceMap,
      },
    });

    webpackConfig.plugins.push(new BuildOptimizerWebpackPlugin());
  }

  return webpackConfig;
}
github ng-qt / ng-qt / packages / devkit / src / utils / aot.config.ts View on Github external
},
      ],
    },
    plugins: [ngCompilerPlugin],
  };

  if (options.optimization) {
    webpackConfig.module.rules.push({
      test: /\.js$/,
      loader: '@angular-devkit/build-optimizer/webpack-loader',
      options: {
        sourceMap: options.sourceMap,
      },
    });

    webpackConfig.plugins.push(new BuildOptimizerWebpackPlugin());
  }

  return webpackConfig;
}

@angular-devkit/build-optimizer

Angular Build Optimizer

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis