@nrwl/angular 15.0.4 → 15.0.5
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/CHANGELOG.md +1 -1
- package/executors.d.ts +1 -0
- package/executors.js +1 -0
- package/executors.js.map +1 -1
- package/executors.json +10 -0
- package/package.json +9 -9
- package/src/builders/webpack-browser/webpack-browser.impl.js +2 -15
- package/src/builders/webpack-browser/webpack-browser.impl.js.map +1 -1
- package/src/builders/webpack-server/schema.d.ts +8 -0
- package/src/builders/webpack-server/schema.json +276 -0
- package/src/builders/webpack-server/webpack-server.impl.d.ts +7 -0
- package/src/builders/webpack-server/webpack-server.impl.js +61 -0
- package/src/builders/webpack-server/webpack-server.impl.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [15.0.
|
|
6
|
+
## [15.0.5](https://github.com/nrwl/nx/compare/15.0.4...15.0.5) (2022-11-01)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/angular
|
package/executors.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './src/builders/module-federation-dev-server/module-federation-dev-server.impl';
|
|
2
2
|
export * from './src/builders/webpack-browser/webpack-browser.impl';
|
|
3
3
|
export * from './src/builders/webpack-dev-server/webpack-dev-server.impl';
|
|
4
|
+
export * from './src/builders/webpack-server/webpack-server.impl';
|
|
4
5
|
export * from './src/executors/delegate-build/delegate-build.impl';
|
|
5
6
|
export * from './src/executors/ng-packagr-lite/ng-packagr-lite.impl';
|
|
6
7
|
export * from './src/executors/package/package.impl';
|
package/executors.js
CHANGED
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./src/builders/module-federation-dev-server/module-federation-dev-server.impl"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./src/builders/webpack-browser/webpack-browser.impl"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./src/builders/webpack-dev-server/webpack-dev-server.impl"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./src/builders/webpack-server/webpack-server.impl"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./src/executors/delegate-build/delegate-build.impl"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./src/executors/ng-packagr-lite/ng-packagr-lite.impl"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./src/executors/package/package.impl"), exports);
|
package/executors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executors.js","sourceRoot":"","sources":["../../../packages/angular/executors.ts"],"names":[],"mappings":";;;AAAA,wHAA8F;AAC9F,8FAAoE;AACpE,oGAA0E;AAC1E,6FAAmE;AACnE,+FAAqE;AACrE,+EAAqD"}
|
|
1
|
+
{"version":3,"file":"executors.js","sourceRoot":"","sources":["../../../packages/angular/executors.ts"],"names":[],"mappings":";;;AAAA,wHAA8F;AAC9F,8FAAoE;AACpE,oGAA0E;AAC1E,4FAAkE;AAClE,6FAAmE;AACnE,+FAAqE;AACrE,+EAAqD"}
|
package/executors.json
CHANGED
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
"schema": "./src/builders/webpack-dev-server/schema.json",
|
|
26
26
|
"description": "The `webpack-dev-server` executor is very similar to the standard `dev-server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration."
|
|
27
27
|
},
|
|
28
|
+
"webpack-server": {
|
|
29
|
+
"implementation": "./src/builders/webpack-server/webpack-server.impl",
|
|
30
|
+
"schema": "./src/builders/webpack-server/schema.json",
|
|
31
|
+
"description": "The `webpack-server` executor is very similar to the standard `server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration and NgUniversal for SSR."
|
|
32
|
+
},
|
|
28
33
|
"module-federation-dev-server": {
|
|
29
34
|
"implementation": "./src/builders/module-federation-dev-server/module-federation-dev-server.impl",
|
|
30
35
|
"schema": "./src/builders/module-federation-dev-server/schema.json",
|
|
@@ -62,6 +67,11 @@
|
|
|
62
67
|
"schema": "./src/builders/webpack-dev-server/schema.json",
|
|
63
68
|
"description": "The `webpack-dev-server` executor is very similar to the standard `dev-server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration."
|
|
64
69
|
},
|
|
70
|
+
"webpack-server": {
|
|
71
|
+
"implementation": "./src/builders/webpack-server/webpack-server.impl",
|
|
72
|
+
"schema": "./src/builders/webpack-server/schema.json",
|
|
73
|
+
"description": "The `webpack-server` executor is very similar to the standard `server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration and NgUniversal for SSR."
|
|
74
|
+
},
|
|
65
75
|
"module-federation-dev-server": {
|
|
66
76
|
"implementation": "./src/builders/module-federation-dev-server/module-federation-dev-server.impl",
|
|
67
77
|
"schema": "./src/builders/module-federation-dev-server/schema.json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/angular",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, Karma, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@angular-devkit/schematics": "~14.2.0",
|
|
70
|
-
"@nrwl/cypress": "15.0.
|
|
71
|
-
"@nrwl/devkit": "15.0.
|
|
72
|
-
"@nrwl/jest": "15.0.
|
|
73
|
-
"@nrwl/linter": "15.0.
|
|
74
|
-
"@nrwl/storybook": "15.0.
|
|
75
|
-
"@nrwl/webpack": "15.0.
|
|
76
|
-
"@nrwl/workspace": "15.0.
|
|
70
|
+
"@nrwl/cypress": "15.0.5",
|
|
71
|
+
"@nrwl/devkit": "15.0.5",
|
|
72
|
+
"@nrwl/jest": "15.0.5",
|
|
73
|
+
"@nrwl/linter": "15.0.5",
|
|
74
|
+
"@nrwl/storybook": "15.0.5",
|
|
75
|
+
"@nrwl/webpack": "15.0.5",
|
|
76
|
+
"@nrwl/workspace": "15.0.5",
|
|
77
77
|
"@phenomnomnominal/tsquery": "4.1.1",
|
|
78
78
|
"@schematics/angular": "~14.2.0",
|
|
79
79
|
"chalk": "4.1.0",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"fesm2015": "fesm2015/nrwl-angular.mjs",
|
|
100
100
|
"typings": "index.d.ts",
|
|
101
101
|
"sideEffects": false,
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "2d84f2565ff4114dee1f476b0087a2707178efe3"
|
|
103
103
|
}
|
|
@@ -5,12 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const architect_1 = require("@angular-devkit/architect");
|
|
6
6
|
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
7
7
|
const devkit_1 = require("@nrwl/devkit");
|
|
8
|
-
const devkit_2 = require("@nrwl/devkit");
|
|
9
8
|
const buildable_libs_utils_1 = require("@nrwl/workspace/src/utilities/buildable-libs-utils");
|
|
10
9
|
const fs_1 = require("fs");
|
|
11
10
|
const path_1 = require("path");
|
|
12
|
-
const rxjs_1 = require("rxjs");
|
|
13
|
-
const operators_1 = require("rxjs/operators");
|
|
14
11
|
const webpack_merge_1 = require("webpack-merge");
|
|
15
12
|
const webpack_1 = require("../utilities/webpack");
|
|
16
13
|
function buildApp(options, context) {
|
|
@@ -52,22 +49,12 @@ function executeWebpackBrowserBuilder(options, context) {
|
|
|
52
49
|
(_a = options.buildLibsFromSource) !== null && _a !== void 0 ? _a : (options.buildLibsFromSource = true);
|
|
53
50
|
let dependencies;
|
|
54
51
|
if (!options.buildLibsFromSource) {
|
|
55
|
-
const result = (0, buildable_libs_utils_1.calculateProjectDependencies)((0,
|
|
52
|
+
const result = (0, buildable_libs_utils_1.calculateProjectDependencies)((0, devkit_1.readCachedProjectGraph)(), context.workspaceRoot, context.target.project, context.target.target, context.target.configuration);
|
|
56
53
|
dependencies = result.dependencies;
|
|
57
54
|
options.tsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)((0, path_1.join)(context.workspaceRoot, options.tsConfig), context.workspaceRoot, result.target.data.root, dependencies);
|
|
58
55
|
process.env.NX_TSCONFIG_PATH = options.tsConfig;
|
|
59
56
|
}
|
|
60
|
-
return (
|
|
61
|
-
? (0, buildable_libs_utils_1.checkDependentProjectsHaveBeenBuilt)(context.workspaceRoot, context.target.project, context.target.target, dependencies)
|
|
62
|
-
: true).pipe((0, operators_1.switchMap)((result) => {
|
|
63
|
-
if (result) {
|
|
64
|
-
return buildApp(options, context);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
// just pass on the result
|
|
68
|
-
return (0, rxjs_1.of)({ success: false });
|
|
69
|
-
}
|
|
70
|
-
}));
|
|
57
|
+
return buildApp(options, context);
|
|
71
58
|
}
|
|
72
59
|
exports.executeWebpackBrowserBuilder = executeWebpackBrowserBuilder;
|
|
73
60
|
exports.default = (0, architect_1.createBuilder)(executeWebpackBrowserBuilder);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-browser.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts"],"names":[],"mappings":";;;;AAAA,yDAImC;AACnC,iEAAsE;AAGtE,
|
|
1
|
+
{"version":3,"file":"webpack-browser.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts"],"names":[],"mappings":";;;;AAAA,yDAImC;AACnC,iEAAsE;AAGtE,yCAAyE;AACzE,6FAI4D;AAC5D,2BAAgC;AAChC,+BAA4B;AAE5B,iDAAsC;AACtC,kDAAkE;AASlE,SAAS,QAAQ,CACf,OAA6B,EAC7B,OAAuB;IAEvB,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,KAC9C,OAAO,EAD4C,eAAe,kBAClE,OAAO,EADH,8CAAgE,CAC7D,CAAC;IACV,8CAA8C;IAC9C,mDAAmD;IACnD,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,IAAI,EAAE;QACnD,MAAM,mBAAmB,GAAG,IAAA,0BAAiB,EAC3C,OAAO,CAAC,aAAa,EACrB,mBAAmB,CAAC,IAAI,CACzB,CAAC;QAEF,IAAI,IAAA,eAAU,EAAC,mBAAmB,CAAC,EAAE;YACnC,OAAO,sCAAsC,CAC3C,eAAe,EACf,OAAO,EACP,mBAAmB,CACpB,CAAC;SACH;aAAM;YACL,MAAM,IAAI,KAAK,CACb,0IAA0I,mBAAmB,EAAE,CAChK,CAAC;SACH;KACF;IAED,OAAO,IAAA,qCAAqB,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,sCAAsC,CAC7C,OAAe,EACf,OAAuB,EACvB,mBAA2B;IAE3B,OAAO,IAAA,qCAAqB,EAAC,OAAO,EAAE,OAAc,EAAE;QACpD,oBAAoB,EAAE,CAAO,iBAAiB,EAAE,EAAE;YAChD,MAAM,0BAA0B,GAAG,IAAA,oCAA0B,EAC3D,mBAAmB,EACnB,OAAO,CAAC,QAAQ,CACjB,CAAC;YACF,gFAAgF;YAChF,yFAAyF;YACzF,4CAA4C;YAC5C,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC;YAEhD,0FA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Capture": "direct-nodejs",
|
|
4
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
5
|
+
"title": "Schema for Webpack Server",
|
|
6
|
+
"description": "The webpack-dev-server executor is very similar to the standard server builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration and NgUniversal for SSR.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"main": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "The full path for the main entry point to the server app, relative to the current workspace."
|
|
12
|
+
},
|
|
13
|
+
"tsConfig": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"default": "tsconfig.app.json",
|
|
16
|
+
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
|
|
17
|
+
},
|
|
18
|
+
"inlineStyleLanguage": {
|
|
19
|
+
"description": "The stylesheet language to use for the application's inline component styles.",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"default": "css",
|
|
22
|
+
"enum": ["css", "less", "sass", "scss"]
|
|
23
|
+
},
|
|
24
|
+
"stylePreprocessorOptions": {
|
|
25
|
+
"description": "Options to pass to style preprocessors",
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"includePaths": {
|
|
29
|
+
"description": "Paths to include. Paths will be resolved to project root.",
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": {
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"default": []
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"additionalProperties": false
|
|
38
|
+
},
|
|
39
|
+
"optimization": {
|
|
40
|
+
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
|
|
41
|
+
"default": true,
|
|
42
|
+
"x-user-analytics": "ep.ng_optimization",
|
|
43
|
+
"oneOf": [
|
|
44
|
+
{
|
|
45
|
+
"type": "object",
|
|
46
|
+
"properties": {
|
|
47
|
+
"scripts": {
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"description": "Enables optimization of the scripts output.",
|
|
50
|
+
"default": true
|
|
51
|
+
},
|
|
52
|
+
"styles": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"description": "Enables optimization of the styles output.",
|
|
55
|
+
"default": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"additionalProperties": false
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "boolean"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"fileReplacements": {
|
|
66
|
+
"description": "Replace compilation source files with other compilation source files in the build.",
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": {
|
|
69
|
+
"$ref": "#/definitions/fileReplacement"
|
|
70
|
+
},
|
|
71
|
+
"default": []
|
|
72
|
+
},
|
|
73
|
+
"outputPath": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"description": "The full path for the new output directory, relative to the current workspace.\n\nBy default, writes output to a folder named dist/ in the current project."
|
|
76
|
+
},
|
|
77
|
+
"resourcesOutputPath": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"description": "The path where style resources will be placed, relative to outputPath."
|
|
80
|
+
},
|
|
81
|
+
"sourceMap": {
|
|
82
|
+
"description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
|
|
83
|
+
"default": false,
|
|
84
|
+
"oneOf": [
|
|
85
|
+
{
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": {
|
|
88
|
+
"scripts": {
|
|
89
|
+
"type": "boolean",
|
|
90
|
+
"description": "Output source maps for all scripts.",
|
|
91
|
+
"default": true
|
|
92
|
+
},
|
|
93
|
+
"styles": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"description": "Output source maps for all styles.",
|
|
96
|
+
"default": true
|
|
97
|
+
},
|
|
98
|
+
"hidden": {
|
|
99
|
+
"type": "boolean",
|
|
100
|
+
"description": "Output source maps used for error reporting tools.",
|
|
101
|
+
"default": false
|
|
102
|
+
},
|
|
103
|
+
"vendor": {
|
|
104
|
+
"type": "boolean",
|
|
105
|
+
"description": "Resolve vendor packages source maps.",
|
|
106
|
+
"default": false
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"additionalProperties": false
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"type": "boolean"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"deployUrl": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "URL where files will be deployed.",
|
|
119
|
+
"x-deprecated": "Use \"baseHref\" browser builder option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
|
|
120
|
+
},
|
|
121
|
+
"verbose": {
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"description": "Adds more details to output logging.",
|
|
124
|
+
"default": false
|
|
125
|
+
},
|
|
126
|
+
"progress": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"description": "Log progress to the console while building.",
|
|
129
|
+
"default": true
|
|
130
|
+
},
|
|
131
|
+
"i18nMissingTranslation": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"description": "How to handle missing translations for i18n.",
|
|
134
|
+
"enum": ["warning", "error", "ignore"],
|
|
135
|
+
"default": "warning"
|
|
136
|
+
},
|
|
137
|
+
"i18nDuplicateTranslation": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"description": "How to handle duplicate translations for i18n.",
|
|
140
|
+
"enum": ["warning", "error", "ignore"],
|
|
141
|
+
"default": "warning"
|
|
142
|
+
},
|
|
143
|
+
"localize": {
|
|
144
|
+
"description": "Translate the bundles in one or more locales.",
|
|
145
|
+
"oneOf": [
|
|
146
|
+
{
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"description": "Translate all locales."
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"type": "array",
|
|
152
|
+
"description": "List of locales ID's to translate.",
|
|
153
|
+
"minItems": 1,
|
|
154
|
+
"items": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"outputHashing": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"description": "Define the output filename cache-busting hashing mode.",
|
|
164
|
+
"default": "none",
|
|
165
|
+
"enum": ["none", "all", "media", "bundles"]
|
|
166
|
+
},
|
|
167
|
+
"deleteOutputPath": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"description": "Delete the output path before building.",
|
|
170
|
+
"default": true
|
|
171
|
+
},
|
|
172
|
+
"preserveSymlinks": {
|
|
173
|
+
"type": "boolean",
|
|
174
|
+
"description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
|
|
175
|
+
},
|
|
176
|
+
"extractLicenses": {
|
|
177
|
+
"type": "boolean",
|
|
178
|
+
"description": "Extract all licenses in a separate file, in the case of production builds only.",
|
|
179
|
+
"default": true
|
|
180
|
+
},
|
|
181
|
+
"namedChunks": {
|
|
182
|
+
"type": "boolean",
|
|
183
|
+
"description": "Use file name for lazy loaded chunks.",
|
|
184
|
+
"default": false
|
|
185
|
+
},
|
|
186
|
+
"externalDependencies": {
|
|
187
|
+
"description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
|
|
188
|
+
"type": "array",
|
|
189
|
+
"items": {
|
|
190
|
+
"type": "string"
|
|
191
|
+
},
|
|
192
|
+
"default": []
|
|
193
|
+
},
|
|
194
|
+
"bundleDependencies": {
|
|
195
|
+
"description": "Which external dependencies to bundle into the bundle. By default, all of node_modules will be bundled.",
|
|
196
|
+
"default": true,
|
|
197
|
+
"oneOf": [
|
|
198
|
+
{
|
|
199
|
+
"type": "boolean"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"type": "string",
|
|
203
|
+
"enum": ["none", "all"]
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
"statsJson": {
|
|
208
|
+
"type": "boolean",
|
|
209
|
+
"description": "Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.",
|
|
210
|
+
"default": false
|
|
211
|
+
},
|
|
212
|
+
"watch": {
|
|
213
|
+
"type": "boolean",
|
|
214
|
+
"description": "Run build when files change.",
|
|
215
|
+
"default": false
|
|
216
|
+
},
|
|
217
|
+
"poll": {
|
|
218
|
+
"type": "number",
|
|
219
|
+
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
220
|
+
},
|
|
221
|
+
"customWebpackConfig": {
|
|
222
|
+
"description": "Options for additional webpack configurations.",
|
|
223
|
+
"type": "object",
|
|
224
|
+
"properties": {
|
|
225
|
+
"path": {
|
|
226
|
+
"description": "Path to additional webpack configuration, relative to the workspace root.",
|
|
227
|
+
"type": "string"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"additionalProperties": false
|
|
231
|
+
},
|
|
232
|
+
"buildLibsFromSource": {
|
|
233
|
+
"type": "boolean",
|
|
234
|
+
"description": "Read buildable libraries from source instead of building them separately.",
|
|
235
|
+
"default": true
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"additionalProperties": false,
|
|
239
|
+
"required": ["outputPath", "main", "tsConfig"],
|
|
240
|
+
"definitions": {
|
|
241
|
+
"fileReplacement": {
|
|
242
|
+
"oneOf": [
|
|
243
|
+
{
|
|
244
|
+
"type": "object",
|
|
245
|
+
"properties": {
|
|
246
|
+
"src": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
249
|
+
},
|
|
250
|
+
"replaceWith": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"additionalProperties": false,
|
|
256
|
+
"required": ["src", "replaceWith"]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"type": "object",
|
|
260
|
+
"properties": {
|
|
261
|
+
"replace": {
|
|
262
|
+
"type": "string",
|
|
263
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
264
|
+
},
|
|
265
|
+
"with": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"additionalProperties": false,
|
|
271
|
+
"required": ["replace", "with"]
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BuilderContext } from '@angular-devkit/architect';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ServerBuilderOutput } from '@angular-devkit/build-angular';
|
|
4
|
+
import { Schema } from './schema';
|
|
5
|
+
export declare function executeWebpackServerBuilder(options: Schema, context: BuilderContext): Observable<ServerBuilderOutput>;
|
|
6
|
+
declare const _default: any;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeWebpackServerBuilder = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
6
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
+
const buildable_libs_utils_1 = require("@nrwl/workspace/src/utilities/buildable-libs-utils");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const webpack_merge_1 = require("webpack-merge");
|
|
11
|
+
const webpack_1 = require("../utilities/webpack");
|
|
12
|
+
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
13
|
+
function buildServerApp(options, context) {
|
|
14
|
+
const { buildLibsFromSource, customWebpackConfig } = options, delegateOptions = tslib_1.__rest(options, ["buildLibsFromSource", "customWebpackConfig"]);
|
|
15
|
+
// If there is a path to custom webpack config
|
|
16
|
+
// Invoke our own support for custom webpack config
|
|
17
|
+
if (customWebpackConfig && customWebpackConfig.path) {
|
|
18
|
+
const pathToWebpackConfig = (0, devkit_1.joinPathFragments)(context.workspaceRoot, customWebpackConfig.path);
|
|
19
|
+
if ((0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
20
|
+
return buildServerAppWithCustomWebpackConfiguration(delegateOptions, context, pathToWebpackConfig);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
throw new Error(`Custom Webpack Config File Not Found!\nTo use a custom webpack config, please ensure the path to the custom webpack file is correct: \n${pathToWebpackConfig}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return (0, build_angular_1.executeServerBuilder)(delegateOptions, context);
|
|
27
|
+
}
|
|
28
|
+
function buildServerAppWithCustomWebpackConfiguration(options, context, pathToWebpackConfig) {
|
|
29
|
+
return (0, build_angular_1.executeServerBuilder)(options, context, {
|
|
30
|
+
webpackConfiguration: (baseWebpackConfig) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const customWebpackConfiguration = (0, webpack_1.resolveCustomWebpackConfig)(pathToWebpackConfig, options.tsConfig);
|
|
32
|
+
// The extra Webpack configuration file can also export a Promise, for instance:
|
|
33
|
+
// `module.exports = new Promise(...)`. If it exports a single object, but not a Promise,
|
|
34
|
+
// then await will just resolve that object.
|
|
35
|
+
const config = yield customWebpackConfiguration;
|
|
36
|
+
// The extra Webpack configuration file can export a synchronous or asynchronous function,
|
|
37
|
+
// for instance: `module.exports = async config => { ... }`.
|
|
38
|
+
if (typeof config === 'function') {
|
|
39
|
+
return config(baseWebpackConfig, options, context.target);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return (0, webpack_merge_1.merge)(baseWebpackConfig, config);
|
|
43
|
+
}
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function executeWebpackServerBuilder(options, context) {
|
|
48
|
+
var _a;
|
|
49
|
+
(_a = options.buildLibsFromSource) !== null && _a !== void 0 ? _a : (options.buildLibsFromSource = true);
|
|
50
|
+
let dependencies;
|
|
51
|
+
if (!options.buildLibsFromSource) {
|
|
52
|
+
const result = (0, buildable_libs_utils_1.calculateProjectDependencies)((0, devkit_1.readCachedProjectGraph)(), context.workspaceRoot, context.target.project, context.target.target, context.target.configuration);
|
|
53
|
+
dependencies = result.dependencies;
|
|
54
|
+
options.tsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)((0, path_1.join)(context.workspaceRoot, options.tsConfig), context.workspaceRoot, result.target.data.root, dependencies);
|
|
55
|
+
process.env.NX_TSCONFIG_PATH = options.tsConfig;
|
|
56
|
+
}
|
|
57
|
+
return buildServerApp(options, context);
|
|
58
|
+
}
|
|
59
|
+
exports.executeWebpackServerBuilder = executeWebpackServerBuilder;
|
|
60
|
+
exports.default = (0, architect_1.createBuilder)(executeWebpackServerBuilder);
|
|
61
|
+
//# sourceMappingURL=webpack-server.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-server/webpack-server.impl.ts"],"names":[],"mappings":";;;;AAAA,yDAA0E;AAE1E,yCAAyE;AACzE,6FAI4D;AAC5D,2BAAgC;AAChC,+BAA4B;AAE5B,iDAAsC;AACtC,kDAAkE;AAClE,iEAGuC;AAGvC,SAAS,cAAc,CACrB,OAAe,EACf,OAAuB;IAEvB,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,KAC9C,OAAO,EAD4C,eAAe,kBAClE,OAAO,EADH,8CAAgE,CAC7D,CAAC;IACV,8CAA8C;IAC9C,m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