Skip to content

Commit

Permalink
Fixed an issue with alias being settled rudely
Browse files Browse the repository at this point in the history
  • Loading branch information
bonkalol committed Feb 9, 2024
1 parent 62bb8c8 commit 52ae6a5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions build/webpack/resolve/alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ const
const aliases = {
'@super': resolve.rootDependencies[0],

// This is required for using jest-mock,
// otherwise jest-mock pulls various Node.js modules into the browser environment.
'graceful-fs': false,
path: false,
picomatch: false,
url: false,

Check failure on line 25 in build/webpack/resolve/alias.js

View workflow job for this annotation

GitHub Actions / linters (20.x)

More than 1 blank line not allowed

Check failure on line 25 in build/webpack/resolve/alias.js

View workflow job for this annotation

GitHub Actions / linters (20.x)

More than 1 blank line not allowed

...$C(pzlr.dependencies).to({}).reduce((map, el, i) => {
const
Expand All @@ -52,4 +47,15 @@ if (pzlr.assets?.['sprite'] != null) {
aliases.sprite = src.assets(pzlr.assets.sprite);
}

if (webpack.ssr) {
Object.assign(aliases, {
// This is required for using jest-mock,
// otherwise jest-mock pulls various Node.js modules into the browser environment.
'graceful-fs': false,
path: false,
picomatch: false,
url: false
});
}

module.exports = aliases;

0 comments on commit 52ae6a5

Please sign in to comment.