@nx/webpack 16.5.0 → 16.6.0-beta.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/generators.json +8 -6
- package/index.d.ts +4 -1
- package/index.js +6 -1
- package/package.json +5 -5
- package/src/generators/configuration/configuration.d.ts +5 -0
- package/src/generators/{webpack-project/webpack-project.js → configuration/configuration.js} +5 -5
- package/src/generators/{webpack-project → configuration}/schema.d.ts +1 -1
- package/src/utils/with-nx.js +12 -1
- package/src/generators/webpack-project/webpack-project.d.ts +0 -5
- /package/src/generators/{webpack-project → configuration}/schema.json +0 -0
package/generators.json
CHANGED
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
"description": "Initialize the `@nrwl/webpack` plugin.",
|
|
9
9
|
"hidden": true
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
11
|
+
"configuration": {
|
|
12
|
+
"aliases": ["webpack-project"],
|
|
13
|
+
"factory": "./src/generators/configuration/configuration#compat",
|
|
14
|
+
"schema": "./src/generators/configuration/schema.json",
|
|
14
15
|
"description": "Add webpack configuration to a project.",
|
|
15
16
|
"hidden": true
|
|
16
17
|
}
|
|
@@ -23,9 +24,10 @@
|
|
|
23
24
|
"aliases": ["ng-add"],
|
|
24
25
|
"hidden": true
|
|
25
26
|
},
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
27
|
+
"configuration": {
|
|
28
|
+
"aliases": ["webpack-project"],
|
|
29
|
+
"factory": "./src/generators/configuration/configuration",
|
|
30
|
+
"schema": "./src/generators/configuration/schema.json",
|
|
29
31
|
"description": "Add webpack configuration to a project.",
|
|
30
32
|
"hidden": true
|
|
31
33
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { configurationGenerator } from './src/generators/configuration/configuration';
|
|
2
|
+
export { configurationGenerator };
|
|
3
|
+
/** @deprecated Use `configurationGenerator` instead. */
|
|
4
|
+
export declare const webpackProjectGenerator: typeof configurationGenerator;
|
|
1
5
|
export * from './src/utils/create-copy-plugin';
|
|
2
6
|
export * from './src/utils/config';
|
|
3
7
|
export * from './src/generators/init/init';
|
|
4
|
-
export * from './src/generators/webpack-project/webpack-project';
|
|
5
8
|
export type { WebDevServerOptions } from './src/executors/dev-server/schema';
|
|
6
9
|
export * from './src/executors/dev-server/dev-server.impl';
|
|
7
10
|
export * from './src/executors/webpack/lib/normalize-options';
|
package/index.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webpackProjectGenerator = exports.configurationGenerator = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const configuration_1 = require("./src/generators/configuration/configuration");
|
|
6
|
+
Object.defineProperty(exports, "configurationGenerator", { enumerable: true, get: function () { return configuration_1.configurationGenerator; } });
|
|
7
|
+
// Exported for backwards compatibility in case a plugin is using the old name.
|
|
8
|
+
/** @deprecated Use `configurationGenerator` instead. */
|
|
9
|
+
exports.webpackProjectGenerator = configuration_1.configurationGenerator;
|
|
4
10
|
tslib_1.__exportStar(require("./src/utils/create-copy-plugin"), exports);
|
|
5
11
|
tslib_1.__exportStar(require("./src/utils/config"), exports);
|
|
6
12
|
tslib_1.__exportStar(require("./src/generators/init/init"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./src/generators/webpack-project/webpack-project"), exports);
|
|
8
13
|
tslib_1.__exportStar(require("./src/executors/dev-server/dev-server.impl"), exports);
|
|
9
14
|
tslib_1.__exportStar(require("./src/executors/webpack/lib/normalize-options"), exports);
|
|
10
15
|
tslib_1.__exportStar(require("./src/executors/webpack/webpack.impl"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.6.0-beta.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": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/core": "^7.15.0",
|
|
33
|
-
"@nrwl/webpack": "16.
|
|
34
|
-
"@nx/devkit": "16.
|
|
35
|
-
"@nx/js": "16.
|
|
33
|
+
"@nrwl/webpack": "16.6.0-beta.0",
|
|
34
|
+
"@nx/devkit": "16.6.0-beta.0",
|
|
35
|
+
"@nx/js": "16.6.0-beta.0",
|
|
36
36
|
"autoprefixer": "^10.4.9",
|
|
37
37
|
"babel-loader": "^9.1.2",
|
|
38
38
|
"browserslist": "^4.21.4",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
77
|
"types": "./index.d.ts",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "5a7ffb93c9e84bffbf52f6ae9c6c1e3b8edb9d35"
|
|
79
79
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Tree } from '@nx/devkit';
|
|
2
|
+
import { ConfigurationGeneratorSchema } from './schema';
|
|
3
|
+
export declare function configurationGenerator(tree: Tree, options: ConfigurationGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
4
|
+
export default configurationGenerator;
|
|
5
|
+
export declare const compat: (generatorOptions: ConfigurationGeneratorSchema) => (tree: any, context: any) => Promise<any>;
|
package/src/generators/{webpack-project/webpack-project.js → configuration/configuration.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.compat = exports.configurationGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const init_1 = require("../init/init");
|
|
7
|
-
function
|
|
7
|
+
function configurationGenerator(tree, options) {
|
|
8
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
9
|
const task = yield (0, init_1.webpackInitGenerator)(tree, Object.assign(Object.assign({}, options), { skipFormat: true }));
|
|
10
10
|
checkForTargetConflicts(tree, options);
|
|
@@ -18,7 +18,7 @@ function webpackProjectGenerator(tree, options) {
|
|
|
18
18
|
return task;
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
exports.
|
|
21
|
+
exports.configurationGenerator = configurationGenerator;
|
|
22
22
|
function checkForTargetConflicts(tree, options) {
|
|
23
23
|
var _a, _b;
|
|
24
24
|
if (options.skipValidation)
|
|
@@ -109,5 +109,5 @@ function addServeTarget(tree, options) {
|
|
|
109
109
|
},
|
|
110
110
|
} }) }));
|
|
111
111
|
}
|
|
112
|
-
exports.default =
|
|
113
|
-
exports.
|
|
112
|
+
exports.default = configurationGenerator;
|
|
113
|
+
exports.compat = (0, devkit_1.convertNxGenerator)(configurationGenerator);
|
package/src/utils/with-nx.js
CHANGED
|
@@ -17,6 +17,17 @@ const nodeExternals = require("webpack-node-externals");
|
|
|
17
17
|
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
|
|
18
18
|
const browserslist = require("browserslist");
|
|
19
19
|
const VALID_BROWSERSLIST_FILES = ['.browserslistrc', 'browserslist'];
|
|
20
|
+
const ES5_BROWSERS = [
|
|
21
|
+
'ie 10',
|
|
22
|
+
'ie 11',
|
|
23
|
+
'safari 11',
|
|
24
|
+
'safari 11.1',
|
|
25
|
+
'safari 12',
|
|
26
|
+
'safari 12.1',
|
|
27
|
+
'safari 13',
|
|
28
|
+
'ios_saf 13.0',
|
|
29
|
+
'ios_saf 13.3',
|
|
30
|
+
];
|
|
20
31
|
function getTerserEcmaVersion(projectRoot) {
|
|
21
32
|
let pathToBrowserslistFile = '';
|
|
22
33
|
for (const browserslistFile of VALID_BROWSERSLIST_FILES) {
|
|
@@ -31,7 +42,7 @@ function getTerserEcmaVersion(projectRoot) {
|
|
|
31
42
|
}
|
|
32
43
|
const env = browserslist.loadConfig({ path: pathToBrowserslistFile });
|
|
33
44
|
const browsers = browserslist(env);
|
|
34
|
-
return browsers.includes(
|
|
45
|
+
return browsers.some((b) => ES5_BROWSERS.includes(b)) ? 5 : 2020;
|
|
35
46
|
}
|
|
36
47
|
const IGNORED_WEBPACK_WARNINGS = [
|
|
37
48
|
/The comment file/i,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Tree } from '@nx/devkit';
|
|
2
|
-
import { WebpackProjectGeneratorSchema } from './schema';
|
|
3
|
-
export declare function webpackProjectGenerator(tree: Tree, options: WebpackProjectGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
4
|
-
export default webpackProjectGenerator;
|
|
5
|
-
export declare const webpackProjectSchematic: (generatorOptions: WebpackProjectGeneratorSchema) => (tree: any, context: any) => Promise<any>;
|
|
File without changes
|