diff --git a/src/asset-relocator.js b/src/asset-relocator.js index 36a8248..631ab1b 100644 --- a/src/asset-relocator.js +++ b/src/asset-relocator.js @@ -350,7 +350,7 @@ module.exports = async function (content, map) { const dir = path.dirname(id); // injection to set __webpack_require__.ab - const options = getOptions(this); + const options = getOptions(this) || {}; injectPathHook(this._compilation, options.outputAssetBase); diff --git a/test/project-chunking/expected.js b/test/project-chunking/expected.js index 54ec661..7755d76 100644 --- a/test/project-chunking/expected.js +++ b/test/project-chunking/expected.js @@ -6,4 +6,4 @@ expect(output.length).toBe(16); // check relative asset references worked out expect(fs.readFileSync(__dirname + "/dist/modules/main.js").toString()).toContain(`ab+"asset`); expect(fs.readFileSync(__dirname + "/dist/modules/chunk.js").toString()).toContain(`ab+"asset`); -expect(fs.readFileSync(__dirname + "/dist/modules/chunks/541.js").toString()).toContain(`ab+"asset`); +expect(fs.readFileSync(__dirname + "/dist/modules/chunks/758.js").toString()).toContain(`ab+"asset`); diff --git a/test/project-chunking/webpack.config.js b/test/project-chunking/webpack.config.js index 7fde191..017bbb2 100644 --- a/test/project-chunking/webpack.config.js +++ b/test/project-chunking/webpack.config.js @@ -16,10 +16,7 @@ module.exports = { test: /\.m?js$/, parser: { amd: false }, use: { - loader: __dirname + '/../../src/asset-relocator.js', - options: { - wrapperCompatibility: true - } + loader: __dirname + '/../../src/asset-relocator.js' } }] }