fix: fix render mp by react error, because window.HTMLIFrameElement is undefined
This commit is contained in:
parent
2487db8d79
commit
78c41823ae
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue