@nx/webpack 16.4.0-beta.1 → 16.4.0-beta.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 +6 -6
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.js +10 -10
- package/src/executors/webpack/schema.d.ts +0 -12
- package/src/generators/init/init.js +0 -4
- package/src/generators/webpack-project/schema.json +1 -1
- package/src/generators/webpack-project/webpack-project.js +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "16.4.0-beta.
|
|
3
|
+
"version": "16.4.0-beta.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": {
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/core": "^7.15.0",
|
|
33
|
-
"@nrwl/webpack": "16.4.0-beta.
|
|
34
|
-
"@nx/devkit": "16.4.0-beta.
|
|
35
|
-
"@nx/js": "16.4.0-beta.
|
|
33
|
+
"@nrwl/webpack": "16.4.0-beta.2",
|
|
34
|
+
"@nx/devkit": "16.4.0-beta.2",
|
|
35
|
+
"@nx/js": "16.4.0-beta.2",
|
|
36
36
|
"autoprefixer": "^10.4.9",
|
|
37
37
|
"babel-loader": "^9.1.2",
|
|
38
38
|
"chalk": "^4.1.0",
|
|
39
39
|
"chokidar": "^3.5.1",
|
|
40
40
|
"copy-webpack-plugin": "^10.2.4",
|
|
41
41
|
"css-loader": "^6.4.0",
|
|
42
|
-
"css-minimizer-webpack-plugin": "^
|
|
42
|
+
"css-minimizer-webpack-plugin": "^5.0.0",
|
|
43
43
|
"dotenv": "~10.0.0",
|
|
44
44
|
"file-loader": "^6.2.0",
|
|
45
45
|
"fork-ts-checker-webpack-plugin": "7.2.13",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
77
|
"types": "./index.d.ts",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "abb2678056668cc8beaaf9c5ebc2a2e6ad487173"
|
|
79
79
|
}
|
|
@@ -7,9 +7,9 @@ const chalk = require("chalk");
|
|
|
7
7
|
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
8
8
|
const wait_until_server_is_listening_1 = require("./lib/wait-until-server-is-listening");
|
|
9
9
|
function ssrDevServerExecutor(options, context) {
|
|
10
|
-
var _a;
|
|
10
|
+
var _a, _b;
|
|
11
11
|
return tslib_1.__asyncGenerator(this, arguments, function* ssrDevServerExecutor_1() {
|
|
12
|
-
var
|
|
12
|
+
var _c, e_1, _d, _e;
|
|
13
13
|
const browserTarget = (0, devkit_1.parseTargetString)(options.browserTarget, context.projectGraph);
|
|
14
14
|
const serverTarget = (0, devkit_1.parseTargetString)(options.serverTarget, context.projectGraph);
|
|
15
15
|
const browserOptions = (0, devkit_1.readTargetOptions)(browserTarget, context);
|
|
@@ -21,17 +21,17 @@ function ssrDevServerExecutor(options, context) {
|
|
|
21
21
|
const combined = (0, async_iterable_1.combineAsyncIterables)(runBrowser, runServer);
|
|
22
22
|
process.env['port'] = `${options.port}`;
|
|
23
23
|
try {
|
|
24
|
-
for (var
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
for (var _f = true, combined_1 = tslib_1.__asyncValues(combined), combined_1_1; combined_1_1 = yield tslib_1.__await(combined_1.next()), _c = combined_1_1.done, !_c;) {
|
|
25
|
+
_e = combined_1_1.value;
|
|
26
|
+
_f = false;
|
|
27
27
|
try {
|
|
28
|
-
const output =
|
|
28
|
+
const output = _e;
|
|
29
29
|
if (!output.success)
|
|
30
30
|
throw new Error('Could not build application');
|
|
31
|
-
if (output.options.target === 'node') {
|
|
31
|
+
if (((_a = output.options) === null || _a === void 0 ? void 0 : _a.target) === 'node') {
|
|
32
32
|
nodeStarted = true;
|
|
33
33
|
}
|
|
34
|
-
else if (((
|
|
34
|
+
else if (((_b = output.options) === null || _b === void 0 ? void 0 : _b.target) === 'web') {
|
|
35
35
|
browserBuilt = true;
|
|
36
36
|
}
|
|
37
37
|
if (nodeStarted && browserBuilt) {
|
|
@@ -41,14 +41,14 @@ function ssrDevServerExecutor(options, context) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
finally {
|
|
44
|
-
|
|
44
|
+
_f = true;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
49
49
|
finally {
|
|
50
50
|
try {
|
|
51
|
-
if (!
|
|
51
|
+
if (!_f && !_c && (_d = combined_1.return)) yield tslib_1.__await(_d.call(combined_1));
|
|
52
52
|
}
|
|
53
53
|
finally { if (e_1) throw e_1.error; }
|
|
54
54
|
}
|
|
@@ -70,28 +70,16 @@ export interface WebpackExecutorOptions {
|
|
|
70
70
|
webpackConfig?: string;
|
|
71
71
|
babelConfig?: string;
|
|
72
72
|
babelUpwardRootMode?: boolean;
|
|
73
|
-
// TODO(jack): Also deprecate these in schema.json once we have migration from executor options to webpack.config.js file.
|
|
74
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
75
73
|
baseHref?: string;
|
|
76
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
77
74
|
crossOrigin?: 'none' | 'anonymous' | 'use-credentials';
|
|
78
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
79
75
|
deployUrl?: string;
|
|
80
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
81
76
|
extractCss?: boolean;
|
|
82
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
83
77
|
generateIndexHtml?: boolean;
|
|
84
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
85
78
|
index?: string;
|
|
86
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
87
79
|
postcssConfig?: string;
|
|
88
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
89
80
|
scripts?: Array<ExtraEntryPointClass | string>;
|
|
90
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
91
81
|
stylePreprocessorOptions?: any;
|
|
92
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
93
82
|
styles?: Array<ExtraEntryPointClass | string>;
|
|
94
|
-
/** @deprecated Moved to withWeb options from `@nx/webpack` */
|
|
95
83
|
subresourceIntegrity?: boolean;
|
|
96
84
|
}
|
|
97
85
|
|
|
@@ -5,13 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const add_swc_dependencies_1 = require("@nx/js/src/utils/swc/add-swc-dependencies");
|
|
7
7
|
const versions_1 = require("../../utils/versions");
|
|
8
|
-
const add_babel_inputs_1 = require("@nx/js/src/utils/add-babel-inputs");
|
|
9
8
|
function webpackInitGenerator(tree, schema) {
|
|
10
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
10
|
const tasks = [];
|
|
12
|
-
if (schema.compiler === 'babel') {
|
|
13
|
-
(0, add_babel_inputs_1.addBabelInputs)(tree);
|
|
14
|
-
}
|
|
15
11
|
const devDependencies = {
|
|
16
12
|
'@nx/webpack': versions_1.nxVersion,
|
|
17
13
|
};
|
|
@@ -37,7 +37,7 @@ function addBuildTarget(tree, options) {
|
|
|
37
37
|
const buildOptions = {
|
|
38
38
|
target: options.target,
|
|
39
39
|
outputPath: (0, devkit_1.joinPathFragments)('dist', project.root),
|
|
40
|
-
compiler: (_a = options.compiler) !== null && _a !== void 0 ? _a : '
|
|
40
|
+
compiler: (_a = options.compiler) !== null && _a !== void 0 ? _a : 'swc',
|
|
41
41
|
main: (_b = options.main) !== null && _b !== void 0 ? _b : (0, devkit_1.joinPathFragments)(project.root, 'src/main.ts'),
|
|
42
42
|
tsConfig: (_c = options.tsConfig) !== null && _c !== void 0 ? _c : (0, devkit_1.joinPathFragments)(project.root, 'tsconfig.app.json'),
|
|
43
43
|
webpackConfig: (0, devkit_1.joinPathFragments)(project.root, 'webpack.config.js'),
|
|
@@ -48,8 +48,11 @@ function addBuildTarget(tree, options) {
|
|
|
48
48
|
if (options.babelConfig) {
|
|
49
49
|
buildOptions.babelConfig = options.babelConfig;
|
|
50
50
|
}
|
|
51
|
-
else {
|
|
52
|
-
|
|
51
|
+
else if (options.compiler === 'babel') {
|
|
52
|
+
// If no babel config file is provided then write a default one, otherwise build will fail.
|
|
53
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(project.root, '.babelrc'), {
|
|
54
|
+
presets: ['@nx/js/babel'],
|
|
55
|
+
});
|
|
53
56
|
}
|
|
54
57
|
if (options.target === 'web') {
|
|
55
58
|
tree.write((0, devkit_1.joinPathFragments)(project.root, 'webpack.config.js'), `
|