Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade html-loader #4629

Merged
merged 3 commits into from
Feb 21, 2021
Merged

Conversation

chenxsan
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Feb 19, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/webpack-docs/webpack-js-org/5u3tppaw3
✅ Preview: https://webpack-js-org-git-fork-chenxsan-feature-upgrade-html-loader.webpack-docs.vercel.app

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend to wait new version of html-webpack-plugin, there are other small bugs

@chenxsan
Copy link
Member Author

@alexander-akait I'm checking if the new feature can fix the problem. Seems not.

@chenxsan
Copy link
Member Author

Error detail:


20:31:51.240 | ERROR in ReferenceError: URL is not defined
-- | --
20:31:51.240 | at evalmachine.<anonymous>:76585:46
20:31:51.240 | at evalmachine.<anonymous>:76586:13
20:31:51.240 | at evalmachine.<anonymous>:76713:12
20:31:51.241 | at webpackUniversalModuleDefinition (evalmachine.<anonymous>:3:20)
20:31:51.241 | at evalmachine.<anonymous>:10:3
20:31:51.241 | at Script.runInContext (vm.js:143:18)
20:31:51.241 | at Script.runInNewContext (vm.js:148:17)
20:31:51.241 | at module.exports (/vercel/workpath0/node_modules/eval/eval.js:73:12)
20:31:51.241 | at /vercel/workpath0/node_modules/static-site-generator-webpack-plugin/index.js:42:22
20:31:51.241 | at fn (/vercel/workpath0/node_modules/webpack/lib/Compilation.js:401:9)
20:31:51.241 | ssg (webpack 5.23.0) compiled with 1 error in 55120 ms


@alexander-akait
Copy link
Member

Bug in static-site-generator-webpack-plugin too

@alexander-akait
Copy link
Member

Here example how to fix it webpack/webpack#12695

@alexander-akait
Copy link
Member

compiler.options.module.defaultRules.push({
  compiler: /mini-css /, // or whatever the name prefix for mini-css child compilers is
  parser: { url: "relative" }
})

@chenxsan
Copy link
Member Author

@chenxsan
Copy link
Member Author

Bug in static-site-generator-webpack-plugin too

Seems to be a problem from the eval package:

image

And here's the code webpack generated:

image

Unfortunately both eval and static-site-generator-webpack-plugin are unmaintained now.

@chenxsan
Copy link
Member Author

chenxsan commented Feb 19, 2021

I might found the culprit nodejs/node#28823.

Assigning URL fix our problem:

image

@chenxsan chenxsan marked this pull request as ready for review February 19, 2021 14:03
@chenxsan chenxsan added the dependencies Pull requests that update a dependency file label Feb 19, 2021
@chenxsan
Copy link
Member Author

So far it works. But in the end we might need to replace static-site-generator-webpack-plugin with something else because:

  1. it's no longer maintained
  2. it modifies compilation.assets which will be a problem because of:
[DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated

@alexander-akait
Copy link
Member

it's no longer maintained

We can move this plugin inside webpack.js.org repo and update old API

@chenxsan
Copy link
Member Author

It surprised me, but eval author had merged the fix.

@chenxsan chenxsan merged commit 02213e4 into webpack:master Feb 21, 2021
@chenxsan chenxsan deleted the feature/upgrade-html-loader branch February 21, 2021 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants