Closed leosxie closed 7 years ago
@lovesmilesha 你的配置发给我看下?
怎么发给你,我找到错误点在你的index.js的438行左右,返回的htmlContent是一个函数,不会带有replace函数了。 console.log("文件内容是:",htmlContent); console.log(compilation.assets[this.options.htmlFileName].source()); // htmlContent = htmlContent.replace("", faviconContent + "").replace("", styleContent + "").replace("
", scriptContent + ""); 加QQ?271912736
新版需要使用html-loader
Unhandled rejection TypeError: htmlContent.replace is not a function at HtmlResWebpackPlugin.injectAssets (/Users/apple/Desktop/jdjob/xx/node_modules/html-res-webpack-plugin/index.js:434:28) at Promise.resolve.then.then.then (/Users/apple/Desktop/jdjob/xx/node_modules/html-res-webpack-plugin/index.js:118:14) at tryCatcher (/Users/apple/Desktop/jdjob/xx/node_modules/bluebird/js/main/util.js:26:23) at Promise._settlePromiseFromHandler (/Users/apple/Desktop/jdjob/xx/node_modules/bluebird/js/main/promise.js:510:31) at Promise._settlePromiseAt (/Users/apple/Desktop/jdjob/xx/node_modules/bluebird/js/main/promise.js:584:18) at Promise._settlePromises (/Users/apple/Desktop/jdjob/xx/node_modules/bluebird/js/main/promise.js:700:14) at Async._drainQueue (/Users/apple/Desktop/jdjob/xx/node_modules/bluebird/js/main/async.js:123:16) at Async._drainQueues (/Users/apple/Desktop/jdjob/xx/node_modules/bluebird/js/main/async.js:133:10) at Immediate.Async.drainQueues (/Users/apple/Desktop/jdjob/xx/node_modules/bluebird/js/main/async.js:15:14) at runCallback (timers.js:637:20) at tryOnImmediate (timers.js:610:5) at processImmediate [as _immediateCallback] (timers.js:582:5)