@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 CHANGED
@@ -8,9 +8,10 @@
8
8
  "description": "Initialize the `@nrwl/webpack` plugin.",
9
9
  "hidden": true
10
10
  },
11
- "webpack-project": {
12
- "factory": "./src/generators/webpack-project/webpack-project#webpackProjectSchematic",
13
- "schema": "./src/generators/webpack-project/schema.json",
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
- "webpack-project": {
27
- "factory": "./src/generators/webpack-project/webpack-project#webpackProjectGenerator",
28
- "schema": "./src/generators/webpack-project/schema.json",
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.5.0",
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.5.0",
34
- "@nx/devkit": "16.5.0",
35
- "@nx/js": "16.5.0",
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": "eaebcc34f92db2200dab0bde2e2e1dde107a47bf"
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>;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.webpackProjectSchematic = exports.webpackProjectGenerator = void 0;
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 webpackProjectGenerator(tree, options) {
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.webpackProjectGenerator = webpackProjectGenerator;
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 = webpackProjectGenerator;
113
- exports.webpackProjectSchematic = (0, devkit_1.convertNxGenerator)(webpackProjectGenerator);
112
+ exports.default = configurationGenerator;
113
+ exports.compat = (0, devkit_1.convertNxGenerator)(configurationGenerator);
@@ -1,4 +1,4 @@
1
- export interface WebpackProjectGeneratorSchema {
1
+ export interface ConfigurationGeneratorSchema {
2
2
  project: string;
3
3
  main?: string;
4
4
  tsConfig?: string;
@@ -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('ie 11') ? 5 : 2020;
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>;