@nx/webpack 22.7.0-pr.35019.f500fd7 → 22.7.0-rc.0
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 +8 -9
- package/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.d.ts.map +1 -1
- package/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.js +6 -3
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +7 -7
- package/project.json +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "22.7.0-
|
|
3
|
+
"version": "22.7.0-rc.0",
|
|
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": {
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"Front-end"
|
|
17
17
|
],
|
|
18
18
|
"main": "./index.js",
|
|
19
|
-
"
|
|
19
|
+
"type": "commonjs",
|
|
20
|
+
"types": "./index.d.ts",
|
|
20
21
|
"author": "Victor Savkin",
|
|
21
22
|
"license": "MIT",
|
|
22
23
|
"bugs": {
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"parse5": "4.0.0",
|
|
50
51
|
"postcss": "^8.4.38",
|
|
51
52
|
"postcss-import": "~14.1.0",
|
|
52
|
-
"postcss-loader": "^
|
|
53
|
+
"postcss-loader": "^8.2.1",
|
|
53
54
|
"rxjs": "^7.8.0",
|
|
54
55
|
"sass": "^1.85.0",
|
|
55
56
|
"sass-embedded": "^1.83.4",
|
|
@@ -64,15 +65,13 @@
|
|
|
64
65
|
"webpack-dev-server": "^5.2.1",
|
|
65
66
|
"webpack-node-externals": "^3.0.0",
|
|
66
67
|
"webpack-subresource-integrity": "^5.1.0",
|
|
67
|
-
"@nx/devkit": "22.7.0-
|
|
68
|
-
"@nx/js": "22.7.0-
|
|
68
|
+
"@nx/devkit": "22.7.0-rc.0",
|
|
69
|
+
"@nx/js": "22.7.0-rc.0"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
71
|
-
"nx": "22.7.0-
|
|
72
|
+
"nx": "22.7.0-rc.0"
|
|
72
73
|
},
|
|
73
74
|
"publishConfig": {
|
|
74
75
|
"access": "public"
|
|
75
|
-
}
|
|
76
|
-
"types": "./index.d.ts",
|
|
77
|
-
"type": "commonjs"
|
|
76
|
+
}
|
|
78
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-tsconfig-paths-webpack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC9B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"nx-tsconfig-paths-webpack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC9B,MAAM,SAAS,CAAC;AAQjB,OAAO,EAAE,mCAAmC,EAAE,MAAM,oDAAoD,CAAC;AAGzG,qBAAa,4BAA4B;IAC3B,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,mCAAmC;IAOhE,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAyB/B,yBAAyB,CACvB,MAAM,EAAE,OAAO,CAAC,wBAAwB,GAAG,aAAa,CAAC,EACzD,OAAO,EAAE,mCAAmC,GAC3C,IAAI;CAoCR"}
|
|
@@ -6,6 +6,7 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
6
6
|
const tsconfig_paths_webpack_plugin_1 = require("tsconfig-paths-webpack-plugin");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
9
|
+
const ts_config_1 = require("@nx/js/src/utils/typescript/ts-config");
|
|
9
10
|
const webpack_nx_build_coordination_plugin_1 = require("../webpack-nx-build-coordination-plugin");
|
|
10
11
|
class NxTsconfigPathsWebpackPlugin {
|
|
11
12
|
constructor(options) {
|
|
@@ -24,10 +25,12 @@ class NxTsconfigPathsWebpackPlugin {
|
|
|
24
25
|
...compiler.options.resolve,
|
|
25
26
|
plugins: compiler.options.resolve?.plugins ?? [],
|
|
26
27
|
};
|
|
28
|
+
const configFile = !path.isAbsolute(this.options.tsConfig)
|
|
29
|
+
? path.join(devkit_1.workspaceRoot, this.options.tsConfig)
|
|
30
|
+
: this.options.tsConfig;
|
|
27
31
|
compiler.options.resolve.plugins.push(new tsconfig_paths_webpack_plugin_1.TsconfigPathsPlugin({
|
|
28
|
-
configFile
|
|
29
|
-
|
|
30
|
-
: this.options.tsConfig,
|
|
32
|
+
configFile,
|
|
33
|
+
baseUrl: (0, ts_config_1.resolvePathsBaseUrl)(configFile),
|
|
31
34
|
extensions: Array.from(extensions),
|
|
32
35
|
mainFields: ['module', 'main'],
|
|
33
36
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAIlB,aAAa,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EASd,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAeD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,oBAAoB,CAiC3D,CAAC;AAEF,eAAO,MAAM,aAAa,qCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -13,7 +13,6 @@ const path_1 = require("path");
|
|
|
13
13
|
const read_webpack_options_1 = require("../utils/webpack/read-webpack-options");
|
|
14
14
|
const resolve_user_defined_webpack_config_1 = require("../utils/webpack/resolve-user-defined-webpack-config");
|
|
15
15
|
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
16
|
-
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
17
16
|
function readTargetsCache(cachePath) {
|
|
18
17
|
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
19
18
|
}
|
|
@@ -36,8 +35,9 @@ exports.createNodes = [
|
|
|
36
35
|
const targetsCache = readTargetsCache(cachePath);
|
|
37
36
|
const normalizedOptions = normalizeOptions(options);
|
|
38
37
|
const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
|
|
38
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
|
|
39
39
|
try {
|
|
40
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup), configFilePaths, normalizedOptions, context);
|
|
40
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup, pmc), configFilePaths, normalizedOptions, context);
|
|
41
41
|
}
|
|
42
42
|
finally {
|
|
43
43
|
writeTargetsToCache(cachePath, targetsCache);
|
|
@@ -45,7 +45,7 @@ exports.createNodes = [
|
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
47
|
exports.createNodesV2 = exports.createNodes;
|
|
48
|
-
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup) {
|
|
48
|
+
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc) {
|
|
49
49
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
50
50
|
// Do not create a project if package.json and project.json isn't there.
|
|
51
51
|
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
@@ -54,7 +54,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
54
54
|
return {};
|
|
55
55
|
}
|
|
56
56
|
const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
|
|
57
|
-
targetsCache[hash] ??= await createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup);
|
|
57
|
+
targetsCache[hash] ??= await createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc);
|
|
58
58
|
const { targets, metadata } = targetsCache[hash];
|
|
59
59
|
return {
|
|
60
60
|
projects: {
|
|
@@ -66,7 +66,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
async function createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup) {
|
|
69
|
+
async function createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc) {
|
|
70
70
|
const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
|
|
71
71
|
const webpackConfig = (0, resolve_user_defined_webpack_config_1.resolveUserDefinedWebpackConfig)((0, path_1.join)(context.workspaceRoot, configFilePath), (0, js_1.getRootTsConfigPath)(), true);
|
|
72
72
|
const webpackOptions = await (0, read_webpack_options_1.readWebpackOptions)(webpackConfig);
|
|
@@ -203,10 +203,10 @@ function normalizeOutputPath(outputPath, projectRoot) {
|
|
|
203
203
|
}
|
|
204
204
|
else {
|
|
205
205
|
if (outputPath.startsWith('..')) {
|
|
206
|
-
return (0,
|
|
206
|
+
return (0, devkit_1.joinPathFragments)('{workspaceRoot}', projectRoot, outputPath);
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
209
|
-
return (0,
|
|
209
|
+
return (0, devkit_1.joinPathFragments)('{projectRoot}', outputPath);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
package/project.json
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "webpack",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "packages/webpack",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
7
|
-
"build": {
|
|
8
|
-
"outputs": ["{workspaceRoot}/dist/packages/webpack/README.md"],
|
|
9
|
-
"command": "node ./scripts/copy-readme.js webpack"
|
|
10
|
-
},
|
|
11
|
-
"legacy-post-build": {
|
|
12
|
-
"executor": "@nx/workspace-plugin:legacy-post-build",
|
|
13
|
-
"options": {
|
|
14
|
-
"tsConfig": "./tsconfig.lib.json",
|
|
15
|
-
"assets": [
|
|
16
|
-
{
|
|
17
|
-
"input": "packages/webpack",
|
|
18
|
-
"glob": "**/files/**",
|
|
19
|
-
"output": "/"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"input": "packages/webpack",
|
|
23
|
-
"glob": "**/files/**/.gitkeep",
|
|
24
|
-
"output": "/"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"input": "packages/webpack",
|
|
28
|
-
"glob": "**/*.json",
|
|
29
|
-
"ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
|
|
30
|
-
"output": "/"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"input": "packages/webpack",
|
|
34
|
-
"glob": "**/*.js",
|
|
35
|
-
"ignore": ["**/jest.config.js"],
|
|
36
|
-
"output": "/"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"input": "packages/webpack",
|
|
40
|
-
"glob": "**/*.d.ts",
|
|
41
|
-
"output": "/"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"input": "",
|
|
45
|
-
"glob": "LICENSE",
|
|
46
|
-
"output": "/"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|