fix: fix render mp by react error, because window.HTMLIFrameElement is undefined

This commit is contained in:
dntzhang 2019-08-16 09:40:24 +08:00
parent 2487db8d79
commit 78c41823ae
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ function wrapChunks(compilation, chunks) {
chunks.forEach(chunk => {
chunk.files.forEach(fileName => {
if (ModuleFilenameHelpers.matchObject({test: /\.js$/}, fileName)) {
const headerContent = 'module.exports = function(window, document) {' + globalVars.map(item => `var ${item} = window.${item}`).join(';') + ';'
const headerContent = 'module.exports = function(window, document) {' + globalVars.map(item => `var ${item} = window.${item}`).join(';') + ';window.HTMLIFrameElement = function(){};'
const footerContent = '}'
compilation.assets[fileName] = new ConcatSource(headerContent, compilation.assets[fileName], footerContent)