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 type { Compiler } from 'webpack'
|
||||||
import { RuntimeGlobals } from 'webpack'
|
import webpack from 'webpack'
|
||||||
|
|
||||||
const pluginName = 'ChunkErrorPlugin'
|
const pluginName = 'ChunkErrorPlugin'
|
||||||
|
|
||||||
const script = `
|
const script = `
|
||||||
if (typeof ${RuntimeGlobals.require} !== "undefined") {
|
if (typeof ${webpack.RuntimeGlobals.require} !== "undefined") {
|
||||||
var _ensureChunk = ${RuntimeGlobals.ensureChunk};
|
var _ensureChunk = ${webpack.RuntimeGlobals.ensureChunk};
|
||||||
${RuntimeGlobals.ensureChunk} = function (chunkId) {
|
${webpack.RuntimeGlobals.ensureChunk} = function (chunkId) {
|
||||||
return Promise.resolve(_ensureChunk(chunkId)).catch(err => {
|
return Promise.resolve(_ensureChunk(chunkId)).catch(err => {
|
||||||
const e = new Event("nuxt.preloadError");
|
const e = new Event("nuxt.preloadError");
|
||||||
e.payload = err;
|
e.payload = err;
|
||||||
|
Loading…
Reference in New Issue
Block a user