numical / script-ext-html-webpack-plugin

Enhances html-webpack-plugin functionality with different deployment options for your scripts including 'async', 'preload', 'prefetch', 'defer', 'module', custom attributes, and inlining.
MIT License
588 stars 105 forks source link

webpack 4 not work #41

Closed aymonYU closed 6 years ago

aymonYU commented 6 years ago

when my webpack update to version 4.0.1,it report 'TypeError: callback is not a function'

sherlock1982 commented 6 years ago

More detailed trace:

ERROR in   TypeError: callback is not a function

  - plugin.js:66 compilation.plugin
    [Webclient]/[script-ext-html-webpack-plugin]/lib/plugin.js:66:11

  - new Promise

  - Hook.js:35 AsyncSeriesWaterfallHook.lazyCompileHook [as _promise]
    [Webclient]/[html-webpack-plugin]/[tapable]/lib/Hook.js:35:21

  - index.js:645
    [Webclient]/[html-webpack-plugin]/index.js:645:47

  - index.js:182 Promise.resolve.then.then.then.then.then.then.then.result
    [Webclient]/[html-webpack-plugin]/index.js:182:18

Looks like one needs to use promise variant now.

ai commented 6 years ago

@numical maybe you need fixes like this? https://github.com/webpack-contrib/uglifyjs-webpack-plugin/commit/23b1b38003953c2952879b5613ef7bafa9678c3c

ai commented 6 years ago

@sherlock1982 can you make a PR?

oychao commented 6 years ago

same question here, @sherlock1982 nice work.

numical commented 6 years ago

Webpack 4 supported in v2.0.0 of this plugin thanks to this PR