Html-webpack-plugin: Webpack 5 Support Plan?

Created on 9 Sep 2019  路  15Comments  路  Source: jantimon/html-webpack-plugin

Most helpful comment

@jantimon Dont know if it is a good place to ask but are there any dates on new release?

Testing the 4.0.0-beta.8 and it's quite a performance booster!

All 15 comments

It is not possible to support webpack 4 and webpack 5 with one version

Therefore I would like to release html-webpack-plugin 4 first before deprecating it 馃槃

@jantimon Will the next version migrate to TypeScript?

We are already using typescript salsa https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc

We would like to do better but this is blocked by https://github.com/microsoft/TypeScript/issues/7546

I hope to expose the definition of getHooks in typings.d.ts.
I am developing a plugin based on html-webpack-plugin.

@jantimon

If you enable allowJs in your tsconfig it should work :)

Pure TypeScript Project, Enable strict-mode.

That should work fine

@jantimon Dont know if it is a good place to ask but are there any dates on new release?

Testing the 4.0.0-beta.8 and it's quite a performance booster!

@jantimon webpack 5 release, first beta version.
https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.0

Initially 4.0.0-beta.8 works with Webpack 5.0.0-beta.0. https://github.com/rwieruch/advanced-react-webpack-babel-setup/commit/d2e6d58cbf31cc7db09decad79f7dc0c22a287c6

But once I change source code, I run into https://github.com/webpack/webpack/issues/9802#issuecomment-542647047:

/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/lib/compiler.js:341
    const timestamp = fileTimestamps.get(fileDependency);
                                     ^

TypeError: Cannot read property 'get' of undefined
    at childCompiler.fileDependencies.some (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/lib/compiler.js:341:38)
    at Array.some (<anonymous>)
    at isChildCompilerCacheOutdated (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/lib/compiler.js:340:59)
    at Object.hasOutDatedTemplateCache (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/lib/compiler.js:321:16)
    at compiler.hooks.thisCompilation.tap (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/index.js:135:25)
    at Hook.eval [as call] (eval at create (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Compiler.newCompilation (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/lib/Compiler.js:713:30)
    at hooks.beforeCompile.callAsync.err (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/lib/Compiler.js:754:29)
    at Hook.eval [as callAsync] (eval at create (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Compiler.compile (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/lib/Compiler.js:749:28)

See also https://github.com/jantimon/html-webpack-plugin/issues/1292

Somehow HTML plugin is causing this error:

ERROR in   TypeError: Cannot read property 'tap' of undefined

  - ExternalModuleFactoryPlugin.js:17 ExternalModuleFactoryPlugin.apply
    [web-modules-core]/[webpack]/lib/ExternalModuleFactoryPlugin.js:17:37

  - ExternalsPlugin.js:16 
    [web-modules-core]/[webpack]/lib/ExternalsPlugin.js:16:63


  - Hook.js:14 Hook.CALL_DELEGATE [as _call]
    [build]/[tapable]/lib/Hook.js:14:14

  - Compiler.js:890 
    [build]/[webpack]/lib/Compiler.js:890:23


  - Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
    [build]/[tapable]/lib/Hook.js:18:14

  - Compiler.js:887 Compiler.compile
    [build]/[webpack]/lib/Compiler.js:887:28

  - Compiler.js:432 Compiler.runAsChild
    [build]/[webpack]/lib/Compiler.js:432:8

  - compiler.js:129 
    [web-modules-core]/[html-webpack-plugin]/lib/compiler.js:129:21

When I remove HTML plugin from config everything works.

The problem is this bug: #1129

Seems that it's working now, version 4.2.0?

Yes 4.2.0 supports webpack 5

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yyx990803 picture yyx990803  路  4Comments

mmjamal picture mmjamal  路  3Comments

ghaiklor picture ghaiklor  路  3Comments

Rowno picture Rowno  路  3Comments

var-bp picture var-bp  路  3Comments