add-asset-html-webpack-plugin icon indicating copy to clipboard operation
add-asset-html-webpack-plugin copied to clipboard

Glob pattern doesn't work

Open g8up opened this issue 6 years ago • 2 comments

I used glob to refer the dll file, and got an error:

Error: Cannot find module '../static/js/**/*.dll.js' Does require.resolve() api realy support glob ?

MyProject
├───build
│   └───webpack.prod.conf.js
├───static
│   └───js
│       └───library_xxx.dll.js
└───package.json
  • webpack.prod.conf.js
new AddAssetHtmlPlugin({
  filepath: require.resolve(`../static/js/**/*.dll.js`),
}),

g8up avatar Dec 30 '18 12:12 g8up

Might be better to do path.resolve(__dirname, '../static/js/**/*.dll.js'). If that works, wanna send a PR updating the docs?

SimenB avatar Dec 31 '18 10:12 SimenB

try this:

new AddAssetHtmlPlugin({
  filepath: `../static/js/**/*.dll.js`,
}),

ssehacker avatar Sep 19 '19 04:09 ssehacker