添加html模板后打包報錯
主要報錯是這個:
ERROR in Path must be a string. Received undefined。代碼如下:
。
有遇到過嗎?我的package.json如下:
{ ??"name":?"webpack4config", ??"version":?"1.0.0", ??"description":?"", ??"main":?"index.js", ??"scripts":?{ ????"test":?"echo?\"Error:?no?test?specified\"?&&?exit?1", ????"webpack":?"webpack?--config?webpack.config.js?--progress?--display-modules?--colors?--display-reason" ??}, ??"keywords":?[], ??"author":?"", ??"license":?"ISC", ??"devDependencies":?{ ????"webpack":?"^4.17.1", ????"webpack-cli":?"^3.1.0", ????"webpack-html-plugin":?"^0.1.1" ??}
2018-08-24
不好意思,搞錯了,html包名稱安裝錯了。是“html-webpack-plugin”而不是“webpack-html-plugin”。安裝對了就沒有問題了