mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 00:52:01 +00:00
fix(webpack): use default export from webpack (#19166)
This commit is contained in:
parent
268cded26c
commit
d2481f9675
@ -1,12 +1,12 @@
|
||||
import type { Compiler } from 'webpack'
|
||||
import { RuntimeGlobals } from 'webpack'
|
||||
import webpack from 'webpack'
|
||||
|
||||
const pluginName = 'ChunkErrorPlugin'
|
||||
|
||||
const script = `
|
||||
if (typeof ${RuntimeGlobals.require} !== "undefined") {
|
||||
var _ensureChunk = ${RuntimeGlobals.ensureChunk};
|
||||
${RuntimeGlobals.ensureChunk} = function (chunkId) {
|
||||
if (typeof ${webpack.RuntimeGlobals.require} !== "undefined") {
|
||||
var _ensureChunk = ${webpack.RuntimeGlobals.ensureChunk};
|
||||
${webpack.RuntimeGlobals.ensureChunk} = function (chunkId) {
|
||||
return Promise.resolve(_ensureChunk(chunkId)).catch(err => {
|
||||
const e = new Event("nuxt.preloadError");
|
||||
e.payload = err;
|
||||
|
Loading…
Reference in New Issue
Block a user