UNPKG

2.76 kBMarkdownView Raw
1# Migration Guide
2
3## 2.x to 3.x
4* Most builds can upgrade directly from 2.x to 3.x without having to change anything.
5* The `webpack-sources` package is no longer bundled with the plugin nor listed as a peerDependency of the plugin. This allows the plugin to use the same version of `webpack-sources` that comes with the `webpack` installation.
6
7## 1.x to 2.x
8* The plugin no longer requires any explicit configuration. By default it will pick up all license types.
9* The plugin no longer writes warnings/errors directly to console and instead reports warnings/errors to webpack.
10* The `modulesDirectories` option defaults to null and requires full paths if specified. When `modulesDirectories` is null, third-party modules may be picked up from any directory.
11* The following options have been removed:
12 - `buildRoot` - The plugin can work reliably without this option having to be specified now. You can remove it from your configuration.
13 - `suppressErrors` - Use the `stats` option on the plugin config instead to turn off warnings/errors.
14 - `pattern` - Use the new `licenseInclusionTest` option instead.
15 - `outputTemplate` - Use the new `renderLicenses` option instead.
16 - `includePackagesWithoutLicense` - Use the new `licenseInclusionTest` option instead.
17 - `unacceptablePattern` - Use the new `unacceptableLicenseTest` option instead.
18 - `abortOnUnacceptableLicense` - The plugin will send an error to webpack whenever an unacceptable license is found. Use the new `handleUnacceptableLicense` option if you want to do something in addition to that.
19 - `bannerTemplate` - Use the new `renderBanner` option instead.
20 - `includedChunks` - Use the new `chunkIncludeExcludeTest` option instead.
21 - `excludedChunks` - Use the new `chunkIncludeExcludeTest` option instead.
22 - `additionalPackages` - Use the new `additionalChunkModules` or `additionalModules` option instead.
23* Check the [documentation](DOCUMENTATION.md) for information on how to use the new options.
24
25## 0.6.x to 1.x
26
27* Change `require('license-webpack-plugin')` to `require('license-webpack-plugin').LicenseWebpackPlugin`.
28* Change `includeUndefined` in the plugin options to `includePackagesWithoutLicense`.
29* The following options have been removed:
30 - `addVersion` - Use the new `outputTemplate` option to configure an ejs template to be used for writing the output.
31 - `addLicenseText` - Use the new `outputTemplate` option to configure an ejs template to be used for writing the output.
32 - `addUrl` - Use the new `outputTemplate` option to configure an ejs template to be used for writing the output.
33 - `filename` - The plugin outputs an individual file per chunk now and is configured by the `outputFilename` option. Check the `README.md` file to see how it works.