Skip to content

Commit

Permalink
feat: make plugin options optional
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Aug 19, 2021
1 parent d711686 commit a1262bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/asset-relocator.js
Expand Up @@ -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);

Expand Down
5 changes: 1 addition & 4 deletions test/project-chunking/webpack.config.js
Expand Up @@ -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'
}
}]
}
Expand Down

0 comments on commit a1262bb

Please sign in to comment.