From 52ae6a5c75c3ddf26876e3e9c2d58df230561333 Mon Sep 17 00:00:00 2001 From: bonkalol Date: Fri, 9 Feb 2024 18:43:17 +0300 Subject: [PATCH 1/4] Fixed an issue with alias being settled rudely --- build/webpack/resolve/alias.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/build/webpack/resolve/alias.js b/build/webpack/resolve/alias.js index e21ee17d3b..74315bb55b 100644 --- a/build/webpack/resolve/alias.js +++ b/build/webpack/resolve/alias.js @@ -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, + ...$C(pzlr.dependencies).to({}).reduce((map, el, i) => { const @@ -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; From 0d74cd21677478a75531342580992d0303cb0634 Mon Sep 17 00:00:00 2001 From: bonkalol Date: Fri, 9 Feb 2024 18:46:28 +0300 Subject: [PATCH 2/4] Fixed bad condition --- build/webpack/resolve/alias.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/webpack/resolve/alias.js b/build/webpack/resolve/alias.js index 74315bb55b..8725d6ee28 100644 --- a/build/webpack/resolve/alias.js +++ b/build/webpack/resolve/alias.js @@ -47,7 +47,7 @@ if (pzlr.assets?.['sprite'] != null) { aliases.sprite = src.assets(pzlr.assets.sprite); } -if (webpack.ssr) { +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. From d0605993e8e05023ed97774011688aaf7a6eb7b9 Mon Sep 17 00:00:00 2001 From: bonkalol Date: Sun, 11 Feb 2024 09:41:50 +0300 Subject: [PATCH 3/4] :art: --- build/webpack/resolve/alias.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/webpack/resolve/alias.js b/build/webpack/resolve/alias.js index 8725d6ee28..b2156e5fc1 100644 --- a/build/webpack/resolve/alias.js +++ b/build/webpack/resolve/alias.js @@ -22,8 +22,6 @@ const const aliases = { '@super': resolve.rootDependencies[0], - - ...$C(pzlr.dependencies).to({}).reduce((map, el, i) => { const asset = resolve.depMap[el].config.assets; From c0237551f82a445ef42f66b0cbfc0d136a51ff7a Mon Sep 17 00:00:00 2001 From: bonkalol Date: Sun, 11 Feb 2024 15:14:11 +0300 Subject: [PATCH 4/4] :art: changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e23901e46..062a9ae21c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ Changelog _Note: Gaps between patch versions are faulty, broken or test releases._ +## v4.0.0-beta.?? (2024-??-??) + +* Fixed an issue with aliases being set for build in ssr `build/webpack/resolve/alias` + ## v4.0.0-beta.56 (2024-02-09) #### :rocket: New Feature