How to use last-call-webpack-plugin - 2 common examples

To help you get started, we’ve selected a few last-call-webpack-plugin 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 NMFR / optimize-css-assets-webpack-plugin / src / index.js View on Github external
constructor(options) {
    super({
      assetProcessors: [
        {
          phase: LastCallWebpackPlugin.PHASES.OPTIMIZE_CHUNK_ASSETS,
          regExp: (options && options.assetNameRegExp) || /\.css(\?.*)?$/i,
          processor: (assetName, asset, assets) =>
            this.processCss(assetName, asset, assets),
        }
      ],
      canPrint: options && options.canPrint,
    });

    this.options.assetNameRegExp = !options || !options.assetNameRegExp ?
      /\.css(\?.*)?$/i :
      options.assetNameRegExp;
    this.options.cssProcessor = !options || !options.cssProcessor ?
        require('cssnano') :
        options.cssProcessor;
    this.options.cssProcessorOptions = !options || options.cssProcessorOptions === undefined ?
      {} :
github basys / basys / packages / basys / lib / webpack / optimize-css-assets-plugin.js View on Github external
apply(compiler) {
    const lastCallInstance = new LastCallWebpackPlugin({
      assetProcessors: [
        {
          phase: LastCallWebpackPlugin.PHASES.OPTIMIZE_CHUNK_ASSETS,
          regExp: /\.css$/g,
          processor: (assetName, asset, assets) => this.processCss(assetName, asset, assets),
        },
      ],
      canPrint: true,
    });
    return lastCallInstance.apply(compiler);
  }

last-call-webpack-plugin

A Webpack plugin that allows to transform \ modify assets just before Webpack emits them.

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis

Popular last-call-webpack-plugin functions