@nx/webpack 20.0.0 → 20.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.",
|
|
6
6
|
"repository": {
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"webpack-dev-server": "^5.0.4",
|
|
70
70
|
"webpack-node-externals": "^3.0.0",
|
|
71
71
|
"webpack-subresource-integrity": "^5.1.0",
|
|
72
|
-
"@nx/devkit": "20.0.
|
|
73
|
-
"@nx/js": "20.0.
|
|
72
|
+
"@nx/devkit": "20.0.2",
|
|
73
|
+
"@nx/js": "20.0.2"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
@@ -47,7 +47,7 @@ class WebpackNxBuildCoordinationPlugin {
|
|
|
47
47
|
try {
|
|
48
48
|
return await new Promise((res) => {
|
|
49
49
|
this.buildCmdProcess = (0, child_process_1.exec)(this.buildCmd, {
|
|
50
|
-
windowsHide:
|
|
50
|
+
windowsHide: false,
|
|
51
51
|
});
|
|
52
52
|
this.buildCmdProcess.stdout.pipe(process.stdout);
|
|
53
53
|
this.buildCmdProcess.stderr.pipe(process.stderr);
|
|
@@ -13,32 +13,32 @@ const path_1 = require("path");
|
|
|
13
13
|
*/
|
|
14
14
|
function mapRemotes(remotes, remoteEntryExt, determineRemoteUrl, isRemoteGlobal = false) {
|
|
15
15
|
const mappedRemotes = {};
|
|
16
|
-
for (const
|
|
17
|
-
if (Array.isArray(
|
|
18
|
-
const
|
|
19
|
-
mappedRemotes[
|
|
16
|
+
for (const nxRemoteProjectName of remotes) {
|
|
17
|
+
if (Array.isArray(nxRemoteProjectName)) {
|
|
18
|
+
const mfRemoteName = normalizeRemoteName(nxRemoteProjectName[0]);
|
|
19
|
+
mappedRemotes[mfRemoteName] = handleArrayRemote(nxRemoteProjectName, remoteEntryExt, isRemoteGlobal);
|
|
20
20
|
}
|
|
21
|
-
else if (typeof
|
|
22
|
-
const
|
|
23
|
-
mappedRemotes[
|
|
21
|
+
else if (typeof nxRemoteProjectName === 'string') {
|
|
22
|
+
const mfRemoteName = normalizeRemoteName(nxRemoteProjectName);
|
|
23
|
+
mappedRemotes[mfRemoteName] = handleStringRemote(nxRemoteProjectName, determineRemoteUrl, isRemoteGlobal);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
return mappedRemotes;
|
|
27
27
|
}
|
|
28
28
|
// Helper function to deal with remotes that are arrays
|
|
29
29
|
function handleArrayRemote(remote, remoteEntryExt, isRemoteGlobal) {
|
|
30
|
-
let [
|
|
31
|
-
|
|
30
|
+
let [nxRemoteProjectName, remoteLocation] = remote;
|
|
31
|
+
const mfRemoteName = normalizeRemoteName(nxRemoteProjectName);
|
|
32
32
|
const remoteLocationExt = (0, path_1.extname)(remoteLocation);
|
|
33
33
|
// If remote location already has .js or .mjs extension
|
|
34
|
-
if (['.js', '.mjs'].includes(remoteLocationExt)) {
|
|
34
|
+
if (['.js', '.mjs', '.json'].includes(remoteLocationExt)) {
|
|
35
35
|
return remoteLocation;
|
|
36
36
|
}
|
|
37
37
|
const baseRemote = remoteLocation.endsWith('/')
|
|
38
38
|
? remoteLocation.slice(0, -1)
|
|
39
39
|
: remoteLocation;
|
|
40
40
|
const globalPrefix = isRemoteGlobal
|
|
41
|
-
? `${
|
|
41
|
+
? `${normalizeRemoteName(nxRemoteProjectName)}@`
|
|
42
42
|
: '';
|
|
43
43
|
// if the remote is defined with anything other than http then we assume it's a promise based remote
|
|
44
44
|
// In that case we should use what the user provides as the remote location
|
|
@@ -50,9 +50,11 @@ function handleArrayRemote(remote, remoteEntryExt, isRemoteGlobal) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
// Helper function to deal with remotes that are strings
|
|
53
|
-
function handleStringRemote(
|
|
54
|
-
const globalPrefix = isRemoteGlobal
|
|
55
|
-
|
|
53
|
+
function handleStringRemote(nxRemoteProjectName, determineRemoteUrl, isRemoteGlobal) {
|
|
54
|
+
const globalPrefix = isRemoteGlobal
|
|
55
|
+
? `${normalizeRemoteName(nxRemoteProjectName)}@`
|
|
56
|
+
: '';
|
|
57
|
+
return `${globalPrefix}${determineRemoteUrl(nxRemoteProjectName)}`;
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
60
|
* Map remote names to a format that can be understood and used by Module
|
|
@@ -66,18 +68,18 @@ function mapRemotesForSSR(remotes, remoteEntryExt, determineRemoteUrl) {
|
|
|
66
68
|
const mappedRemotes = {};
|
|
67
69
|
for (const remote of remotes) {
|
|
68
70
|
if (Array.isArray(remote)) {
|
|
69
|
-
let [
|
|
70
|
-
|
|
71
|
+
let [nxRemoteProjectName, remoteLocation] = remote;
|
|
72
|
+
const mfRemoteName = normalizeRemoteName(nxRemoteProjectName);
|
|
71
73
|
const remoteLocationExt = (0, path_1.extname)(remoteLocation);
|
|
72
|
-
mappedRemotes[
|
|
74
|
+
mappedRemotes[mfRemoteName] = `${mfRemoteName}@${['.js', '.mjs', '.json'].includes(remoteLocationExt)
|
|
73
75
|
? remoteLocation
|
|
74
76
|
: `${remoteLocation.endsWith('/')
|
|
75
77
|
? remoteLocation.slice(0, -1)
|
|
76
78
|
: remoteLocation}/remoteEntry.${remoteEntryExt}`}`;
|
|
77
79
|
}
|
|
78
80
|
else if (typeof remote === 'string') {
|
|
79
|
-
const
|
|
80
|
-
mappedRemotes[
|
|
81
|
+
const mfRemoteName = normalizeRemoteName(remote);
|
|
82
|
+
mappedRemotes[mfRemoteName] = `${mfRemoteName}@${determineRemoteUrl(remote)}`;
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
return mappedRemotes;
|