SimenB / add-asset-html-webpack-plugin

Add a JavaScript or CSS asset to the HTML generated by html-webpack-plugin
MIT License
335 stars 42 forks source link

Glob pattern doesn't work #146

Open g8up opened 5 years ago

g8up commented 5 years ago

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
SimenB commented 5 years ago

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

ssehacker commented 4 years ago

try this:

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