Skip to content

Commit

Permalink
fix(webpack): use default export from webpack (#19166)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 20, 2023
1 parent 268cded commit d2481f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/webpack/src/plugins/chunk.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit d2481f9

Please sign in to comment.