jantimon/html-webpack-plugin

Don't work with webpack.IgnorePlugin

xuxicheta opened this issue ยท 1 comments

Current behaviour ๐Ÿ’ฃ

index.html
<script type="text/javascript" src="xxxx" ></script>
in plugins
new webpack.IgnorePlugin({ resourceRegExp: /.*xxxx/u }),

result:
Module not found: Error: Can't resolve './xxxx' in '/js/webpack/src'

Expected behaviour โ˜€๏ธ

successful comppile

Reproduction Example ๐Ÿ‘พ

"plugins": [
    new HtmlWebpackPlugin({
      template: './src/index.html',
    }),
   new webpack.IgnorePlugin({ resourceRegExp: /.*xxxx/u, contextRegExp: /xxxx/u  }),
]

src/index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script
    type="text/javascript"
    src="xxxx"
  ></script>
</head>
<body>

</body>
</html>

https://codesandbox.io/s/html-webpack-plugin-5-x-alpha-forked-r2h2w?file=/webpack.config.js

Environment ๐Ÿ–ฅ

npm --version
npm ls webpack
webpack@1.0.0 C:\js\veeam\propartner\webpack
+-- @types/webpack@5.28.0
| -- webpack@5.61.0 deduped -- webpack@5.61.0

npm ls html-webpack-plugin
webpack@1.0.0 C:\js\veeam\propartner\webpack
`-- html-webpack-plugin@5.3.1

Was this resolved?