@nx/webpack 20.2.2 → 20.3.0-beta.1
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 +3 -3
- package/src/executors/webpack/lib/normalize-options.js +2 -0
- package/src/executors/webpack/schema.d.ts +1 -0
- package/src/plugins/nx-webpack-plugin/lib/apply-base-config.js +7 -2
- package/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.d.ts +4 -0
- package/src/utils/config.js +1 -0
- package/src/utils/webpack/read-webpack-options.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.3.0-beta.1",
|
|
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": {
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"webpack-dev-server": "^5.0.4",
|
|
66
66
|
"webpack-node-externals": "^3.0.0",
|
|
67
67
|
"webpack-subresource-integrity": "^5.1.0",
|
|
68
|
-
"@nx/devkit": "20.
|
|
69
|
-
"@nx/js": "20.
|
|
68
|
+
"@nx/devkit": "20.3.0-beta.1",
|
|
69
|
+
"@nx/js": "20.3.0-beta.1"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
@@ -4,9 +4,11 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
exports.normalizePluginPath = normalizePluginPath;
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const normalize_options_1 = require("../../../plugins/nx-webpack-plugin/lib/normalize-options");
|
|
7
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
8
|
function normalizeOptions(options, root, projectRoot, sourceRoot) {
|
|
8
9
|
const normalizedOptions = {
|
|
9
10
|
...options,
|
|
11
|
+
useTsconfigPaths: !(0, ts_solution_setup_1.isUsingTsSolutionSetup)(),
|
|
10
12
|
root,
|
|
11
13
|
projectRoot,
|
|
12
14
|
sourceRoot,
|
|
@@ -177,9 +177,14 @@ function applyNxDependentConfig(options, config, { useNormalizedEntry } = {}) {
|
|
|
177
177
|
configurationName: options.configurationName,
|
|
178
178
|
root: options.root,
|
|
179
179
|
};
|
|
180
|
-
|
|
180
|
+
const isUsingTsSolution = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
|
|
181
|
+
options.useTsconfigPaths ??= !isUsingTsSolution;
|
|
182
|
+
// If the project is using ts solutions setup, the paths are not in tsconfig and we should not use the plugin's paths.
|
|
183
|
+
if (options.useTsconfigPaths) {
|
|
184
|
+
plugins.push(new nx_tsconfig_paths_webpack_plugin_1.NxTsconfigPathsWebpackPlugin({ ...options, tsConfig }));
|
|
185
|
+
}
|
|
181
186
|
// New TS Solution already has a typecheck target
|
|
182
|
-
if (!options?.skipTypeChecking && !
|
|
187
|
+
if (!options?.skipTypeChecking && !isUsingTsSolution) {
|
|
183
188
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
184
189
|
plugins.push(new ForkTsCheckerWebpackPlugin({
|
|
185
190
|
typescript: {
|
|
@@ -202,6 +202,10 @@ export interface NxAppWebpackPluginOptions {
|
|
|
202
202
|
* List of TypeScript Compiler Transformers Plugins.
|
|
203
203
|
*/
|
|
204
204
|
transformers?: TransformerEntry[];
|
|
205
|
+
/**
|
|
206
|
+
* Use tsconfig-paths-webpack-plugin to resolve modules using paths in the tsconfig file.
|
|
207
|
+
*/
|
|
208
|
+
useTsconfigPaths?: boolean;
|
|
205
209
|
/**
|
|
206
210
|
* Generate a separate vendor chunk for 3rd party packages.
|
|
207
211
|
*/
|
package/src/utils/config.js
CHANGED