Skip to content

Releases: lostpebble/generate-package-json-webpack-plugin

2.5.0 - exclude dependencies

02 Nov 23:15
Compare
Choose a tag to compare

Added the option to exclude dependencies, for example:

{
  excludeDependencies: ["aws-sdk"],
}

Here you can set any dependencies you absolutely never want in your output package.json file, even if they happen to be used by your code. This is useful in some edge cases, such as where an execution environment provides these dependencies for you automatically, without installation required.

2.3.0 - better `package.json` resolving

14 Sep 15:13
Compare
Choose a tag to compare

Fixes #34 - due to the issues discussed here: nodejs/node#33460 - package.json is not always resolvable using Nodejs's available module methods (require.resolve) - so a new function has been devised to get around this.

2.2.0 : Force Webpack version option

08 Sep 08:03
Compare
Choose a tag to compare

This release adds the ability to force the plugin to act as if it were under an exact Webpack version. This is useful in environments (such as Nx) where Webpack versions seem to clash and confuses the library as to which methods it should be using.

Simply add the new option:

{
   forceWebpackVersion: "webpack4" | "webpack5"
}

2.1.0 - Webpack 5 support

29 Oct 23:17
Compare
Choose a tag to compare

Thanks to @lorenzodallavecchia for bringing this plugin up to scratch for Webpack 5, along with maintaining its backwards compatibility!

2.0.0 API Simplification Release

08 Oct 12:36
Compare
Choose a tag to compare

Breaking Changes

Simplification of the API.

  • Only two parameters to be provided now, the basePackage and options
  • Made useInstalledVersions defaulted to true
  • The old way of specifying versionsPackageFiles is still possible - needs to be provided as an option now

Webpack 4 support

01 Mar 13:10
Compare
Choose a tag to compare

Thanks to @zhaofengli for the relevant changes! This module should now be compatible with the latest version of Webpack.

v0.4.2: Fix plugin if used while "watch"-ing

13 Dec 12:38
Compare
Choose a tag to compare

Fixed an issue which prevented the plugin working correctly while watching. This was due to the final generated package.json object being mutated instead of re-assigned, which caused issues on the next watch build cycle.

Much thanks to @mjmasn for discovering the issue and the cause!

v0.4.0 Debugging and Additional source package.json files

23 Nov 14:27
Compare
Choose a tag to compare

Added the ability to have some debugging output in the console if you like.

There is also the ability to add more package.json files as additional sources to grab versions from. This is especially useful if you are bundling some external module with your Node.js code which has dependencies it relies on which are outside of your base project package.json file. Now, if Webpack encounters any of those dependencies in your bundle code, it will also include them in your final generated package.json file - which should mitigate problems of missing modules, or having to deliberately set them in your base project package.json file (prone to becoming stale and outdated).

There is now a third argument to the plugin that you can pass an option object to:

generatePackageJsonPlugin(
  ...,
  ...,
  {
     debug: true,
     extraSourcePackageFilenames: [
       join(__dirname, "../../node_modules/@mycompany/services/package.json"),
    ],
  }
)

v0.3.0 Allow non-bundled dependencies

01 Nov 12:55
Compare
Choose a tag to compare

Added the ability to put non-webpack dependencies into the generated package.json, by adding them in the basePackageValues. They can either pull their version from your original package.json by keeping the version string empty (""), or set their version deliberately as you would in any regular package.json.

See Readme for more details.

v0.2.0 Detect modules in all chunks

15 Oct 11:38
Compare
Choose a tag to compare

Thanks to @hlehmann for the changes with #2

Breaking changes

Which should have been default behaviour all along

If you are chunking your files (code-splitting etc.), this plugin should now detect all modules across all chunks and generate a package.json including all of them.