How to use license-webpack-plugin - 10 common examples

To help you get started, we’ve selected a few license-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 angular / angular-cli / packages / angular_devkit / build_angular / src / angular-cli-files / models / webpack-configs / browser.ts View on Github external
if ((stylesSourceMap || scriptsSourceMap) &&
    buildOptions.evalSourceMap &&
    !stylesOptimization &&
    !scriptsOptimization) {
    // Produce eval sourcemaps for development with serve, which are faster.
    isEval = true;
  }

  if (buildOptions.subresourceIntegrity) {
    extraPlugins.push(new SubresourceIntegrityPlugin({
      hashFuncNames: ['sha384'],
    }));
  }

  if (buildOptions.extractLicenses) {
    extraPlugins.push(new LicenseWebpackPlugin({
      stats: {
        warnings: false,
        errors: false,
      },
      perChunkOutput: false,
      outputFilename: `3rdpartylicenses.txt`,
    }));
  }

  if (!isEval && (scriptsSourceMap || stylesSourceMap)) {
    extraPlugins.push(getSourceMapDevTool(
      scriptsSourceMap,
      stylesSourceMap,
      wco.differentialLoadingMode ? true : hiddenSourceMap,
    ));
  }
github angular / angular-cli / packages / angular_devkit / build_webpack / src / angular-cli-files / models / webpack-configs / production.ts View on Github external
// Copy the worker script into assets.
      const workerContents = fs.readFileSync(workerPath).toString();
      extraPlugins.push(new StaticAssetPlugin('worker-basic.min.js', workerContents));

      // Add a script to index.html that registers the service worker.
      // TODO(alxhub): inline this script somehow.
      entryPoints['sw-register'] = [registerPath];
    }
  }

  extraPlugins.push(new BundleBudgetPlugin({
    budgets: appConfig.budgets
  }));

  if (buildOptions.extractLicenses) {
    extraPlugins.push(new LicenseWebpackPlugin({
      pattern: /^(MIT|ISC|BSD.*)$/,
      suppressErrors: true,
      perChunkOutput: false,
      outputFilename: `3rdpartylicenses.txt`
    }));
  }

  const uglifyCompressOptions: any = {
    // Disabled because of an issue with Mapbox GL when using the Webpack node global and UglifyJS:
    // https://github.com/mapbox/mapbox-gl-js/issues/4359#issuecomment-303880888
    // https://github.com/angular/angular-cli/issues/5804
    // https://github.com/angular/angular-cli/pull/7931
    typeofs : false
  };

  if (buildOptions.buildOptimizer) {
github nrwl / nx / packages / node / src / utils / config.ts View on Github external
],
    watch: options.watch,
    watchOptions: {
      poll: options.poll
    },
    stats: getStatsConfig(options)
  };

  const extraPlugins: webpack.Plugin[] = [];

  if (options.progress) {
    extraPlugins.push(new ProgressPlugin());
  }

  if (options.extractLicenses) {
    extraPlugins.push((new LicenseWebpackPlugin({
      stats: {
        errors: false
      },
      perChunkOutput: false,
      outputFilename: `3rdpartylicenses.txt`
    }) as unknown) as webpack.Plugin);
  }

  // process asset entries
  if (options.assets) {
    const copyWebpackPluginPatterns = options.assets.map((asset: any) => {
      return {
        context: asset.input,
        // Now we remove starting slash to make Webpack place it from the output root.
        to: asset.output,
        ignore: asset.ignore,
github rxweb / rxweb / rxweb.io / node_modules / @angular-devkit / build-angular / src / angular-cli-files / models / webpack-configs / browser.js View on Github external
if (buildOptions.evalSourceMap && !buildOptions.optimization) {
            // Produce eval sourcemaps for development with serve, which are faster.
            sourcemaps = 'eval';
        }
        else {
            // Produce full separate sourcemaps for production.
            sourcemaps = 'source-map';
        }
    }
    if (buildOptions.subresourceIntegrity) {
        extraPlugins.push(new SubresourceIntegrityPlugin({
            hashFuncNames: ['sha384']
        }));
    }
    if (buildOptions.extractLicenses) {
        extraPlugins.push(new license_webpack_plugin_1.LicenseWebpackPlugin({
            pattern: /.*/,
            suppressErrors: true,
            perChunkOutput: false,
            outputFilename: `3rdpartylicenses.txt`
        }));
    }
    const globalStylesBundleNames = utils_1.normalizeExtraEntryPoints(buildOptions.styles, 'styles')
        .map(style => style.bundleName);
    return {
        devtool: sourcemaps,
        resolve: {
            mainFields: [
                ...(wco.supportES2015 ? ['es2015'] : []),
                'browser', 'module', 'main'
            ]
        },
github nrwl / nx / packages / web / src / utils / config.ts View on Github external
if (isScriptOptimizeOn) {
    webpackConfig.optimization = {
      minimizer: [createTerserPlugin(esm)],
      runtimeChunk: true
    };
  }

  const extraPlugins: webpack.Plugin[] = [];

  if (options.progress) {
    extraPlugins.push(new ProgressPlugin());
  }

  if (options.extractLicenses) {
    extraPlugins.push((new LicenseWebpackPlugin({
      stats: {
        errors: false
      },
      perChunkOutput: false,
      outputFilename: `3rdpartylicenses.txt`
    }) as unknown) as webpack.Plugin);
  }

  // process asset entries
  if (options.assets) {
    const copyWebpackPluginPatterns = options.assets.map((asset: any) => {
      return {
        context: asset.input,
        // Now we remove starting slash to make Webpack place it from the output root.
        to: asset.output,
        ignore: asset.ignore,
github nrwl / nx / packages / web / src / utils / third-party / cli-files / models / webpack-configs / browser.ts View on Github external
) {
    // Produce eval sourcemaps for development with serve, which are faster.
    isEval = true;
  }

  if (buildOptions.subresourceIntegrity) {
    extraPlugins.push(
      new SubresourceIntegrityPlugin({
        hashFuncNames: ['sha384']
      })
    );
  }

  if (buildOptions.extractLicenses) {
    extraPlugins.push(
      new LicenseWebpackPlugin({
        stats: {
          warnings: false,
          errors: false
        },
        perChunkOutput: false,
        outputFilename: `3rdpartylicenses.txt`
      })
    );
  }

  if (!isEval && (scriptsSourceMap || stylesSourceMap)) {
    extraPlugins.push(
      getSourceMapDevTool(
        !!scriptsSourceMap,
        !!stylesSourceMap,
        hiddenSourceMap
github angular / angular-cli / packages / @angular / cli / models / webpack-configs / production.ts View on Github external
if (!isModernSw) {
      throw new Error(stripIndent`
        The installed version of @angular/service-worker is ${swVersion}. This version of the CLI
        requires the @angular/service-worker version to satisfy ${NEW_SW_VERSION}. Please upgrade
        your service worker version.
      `);
    }
  }

  extraPlugins.push(new BundleBudgetPlugin({
    budgets: appConfig.budgets
  }));

  if (buildOptions.extractLicenses) {
    extraPlugins.push(new LicenseWebpackPlugin({
      pattern: /^(MIT|ISC|BSD.*)$/,
      suppressErrors: true,
      perChunkOutput: false,
      outputFilename: `3rdpartylicenses.txt`
    }));
  }

  return {
    plugins: extraPlugins,
  };
}
github angular / angular-cli / packages / @angular / cli / models / webpack-configs / browser.ts View on Github external
filename: '[file].map[query]',
        moduleFilenameTemplate: '[resource-path]',
        fallbackModuleFilenameTemplate: '[resource-path]?[hash]',
        sourceRoot: 'webpack:///'
      }));
    }
  }

  if (buildOptions.subresourceIntegrity) {
    extraPlugins.push(new SubresourceIntegrityPlugin({
      hashFuncNames: ['sha384']
    }));
  }

  if (buildOptions.extractLicenses) {
    extraPlugins.push(new LicenseWebpackPlugin({
      pattern: /.*/,
      suppressErrors: true,
      perChunkOutput: false,
      outputFilename: `3rdpartylicenses.txt`
    }));
  }

  const globalStylesEntries = extraEntryParser(appConfig.styles, appRoot, 'styles')
    .map(style => style.entry);

  return {
    resolve: {
      mainFields: [
        ...(wco.supportES2015 ? ['es2015'] : []),
        'browser', 'module', 'main'
      ]
github zeebe-io / zeebe-modeler / client / webpack.config.js View on Github external
function extractDependencies() {

  if (!LICENSE_CHECK) {
    return [];
  }

  return [
    new LicenseWebpackPlugin({
      outputFilename: 'dependencies.json',
      perChunkOutput: false,
      renderLicenses: (modules) => {

        const usedModules = modules.reduce((result, m) => {

          const {
            name,
            version
          } = m.packageJson;

          const id = `${name}@${version}`;

          return {
            ...result,
            [id]: true
github johandb / svg-drawing-tool / node_modules / @angular-devkit / build-angular / src / angular-cli-files / models / webpack-configs / browser.js View on Github external
extraPlugins.push(new index_html_webpack_plugin_1.IndexHtmlWebpackPlugin({
            input: path.resolve(root, buildOptions.index),
            output: path.basename(buildOptions.index),
            baseHref: buildOptions.baseHref,
            entrypoints: package_chunk_sort_1.generateEntryPoints(buildOptions),
            deployUrl: buildOptions.deployUrl,
            sri: buildOptions.subresourceIntegrity,
        }));
    }
    if (buildOptions.subresourceIntegrity) {
        extraPlugins.push(new SubresourceIntegrityPlugin({
            hashFuncNames: ['sha384'],
        }));
    }
    if (buildOptions.extractLicenses) {
        extraPlugins.push(new license_webpack_plugin_1.LicenseWebpackPlugin({
            stats: {
                warnings: false,
                errors: false,
            },
            perChunkOutput: false,
            outputFilename: `3rdpartylicenses.txt`,
        }));
    }
    if (!isEval && (scriptsSourceMap || stylesSourceMap)) {
        extraPlugins.push(utils_1.getSourceMapDevTool(scriptsSourceMap, stylesSourceMap, hiddenSourceMap));
    }
    const globalStylesBundleNames = utils_1.normalizeExtraEntryPoints(buildOptions.styles, 'styles')
        .map(style => style.bundleName);
    return {
        devtool: isEval ? 'eval' : false,
        resolve: {

license-webpack-plugin

Outputs licenses from 3rd party libraries to a file

ISC
Latest version published 3 years ago

Package Health Score

76 / 100
Full package analysis

Popular license-webpack-plugin functions