sonatype-nexus-community / copy-modules-webpack-plugin

A Webpack plugin which copies module sources to a separate directory
Apache License 2.0
18 stars 7 forks source link

includePackageJsons not including package.json files in node_modules #19

Closed mojave27 closed 4 years ago

mojave27 commented 4 years ago

Thanks for creating an issue! Please fill out this form so we can be sure to have all the information we need, and to minimize back and forth.

const CopyModulesPlugin = require("copy-modules-webpack-plugin")

module.exports = {
  webpack: {
    plugins: [
      new CopyModulesPlugin({
    destination: 'webpack_modules',
    includePackageJsons: true
      })
    ]
  }
};

I run the plugin via an npm script, which runs "craco build".

I am using 2.0.2 of copy-modules-webpack-plugin, and 4.1.0 of craco.

Listing of webpack_modules/node_modules/*/package.json:

$: ls webpack_modules
node_modules
src

$: ls webpack_modules/node_modules/*/package.json
ls: webpack_modules/node_modules/*/package.json: No such file or directory

Most likely I am missing a key step, but have been unable to identify it.

rpokorny commented 4 years ago

I am using 2.0.2 of copy-modules-webpack-plugin

That feature was introduced in 2.1.0, so I recommend upgrading to a newer version. 2.1.1 is the newest.

mojave27 commented 4 years ago

Oh, I'm a moron. That fixed it. Thanks @rpokorny