@angular-builders/custom-webpack 14.1.0 → 15.0.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/README.md CHANGED
@@ -129,7 +129,7 @@ Builder options:
129
129
  "outputPath": "dist/my-cool-client",
130
130
  "index": "src/index.html",
131
131
  "main": "src/main.ts",
132
- "polyfills": "src/polyfills.ts",
132
+ "polyfills": ["zone.js"],
133
133
  "tsConfig": "src/tsconfig.app.json"
134
134
  }
135
135
  ```
@@ -228,7 +228,7 @@ Builder options:
228
228
  "path": "./extra-webpack.config.js"
229
229
  },
230
230
  "main": "src/test.ts",
231
- "polyfills": "src/polyfills.ts",
231
+ "polyfills": ["zone.js"],
232
232
  "tsConfig": "src/tsconfig.spec.json",
233
233
  "karmaConfig": "src/karma.conf.js",
234
234
  }
@@ -17,8 +17,22 @@
17
17
  "description": "The full path for the main entry point to the app, relative to the current workspace."
18
18
  },
19
19
  "polyfills": {
20
- "type": "string",
21
- "description": "The full path for the polyfills file, relative to the current workspace."
20
+ "description": "Polyfills to be included in the build.",
21
+ "oneOf": [
22
+ {
23
+ "type": "array",
24
+ "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
25
+ "items": {
26
+ "type": "string",
27
+ "uniqueItems": true
28
+ },
29
+ "default": []
30
+ },
31
+ {
32
+ "type": "string",
33
+ "description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
34
+ }
35
+ ]
22
36
  },
23
37
  "tsConfig": {
24
38
  "type": "string",
@@ -74,7 +88,7 @@
74
88
  "input": {
75
89
  "type": "string",
76
90
  "description": "The file to include.",
77
- "pattern": "\\.(?:css|scss|sass|less|styl)$"
91
+ "pattern": "\\.(?:css|scss|sass|less)$"
78
92
  },
79
93
  "bundleName": {
80
94
  "type": "string",
@@ -95,7 +109,7 @@
95
109
  {
96
110
  "type": "string",
97
111
  "description": "The file to include.",
98
- "pattern": "\\.(?:css|scss|sass|less|styl)$"
112
+ "pattern": "\\.(?:css|scss|sass|less)$"
99
113
  }
100
114
  ]
101
115
  }
@@ -128,8 +142,8 @@
128
142
  },
129
143
  "optimization": {
130
144
  "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
131
- "x-user-analytics": 16,
132
145
  "default": true,
146
+ "x-user-analytics": "ep.ng_optimization",
133
147
  "oneOf": [
134
148
  {
135
149
  "type": "object",
@@ -211,7 +225,7 @@
211
225
  "aot": {
212
226
  "type": "boolean",
213
227
  "description": "Build using Ahead of Time compilation.",
214
- "x-user-analytics": 13,
228
+ "x-user-analytics": "ep.ng_aot",
215
229
  "default": true
216
230
  },
217
231
  "sourceMap": {
@@ -251,7 +265,7 @@
251
265
  },
252
266
  "vendorChunk": {
253
267
  "type": "boolean",
254
- "description": "Generate a seperate bundle containing only vendor libraries. This option should only used for development.",
268
+ "description": "Generate a seperate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
255
269
  "default": false
256
270
  },
257
271
  "commonChunk": {
@@ -17,8 +17,22 @@
17
17
  "description": "The name of the Karma configuration file."
18
18
  },
19
19
  "polyfills": {
20
- "type": "string",
21
- "description": "The name of the polyfills file."
20
+ "description": "Polyfills to be included in the build.",
21
+ "oneOf": [
22
+ {
23
+ "type": "array",
24
+ "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
25
+ "items": {
26
+ "type": "string",
27
+ "uniqueItems": true
28
+ },
29
+ "default": []
30
+ },
31
+ {
32
+ "type": "string",
33
+ "description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
34
+ }
35
+ ]
22
36
  },
23
37
  "assets": {
24
38
  "type": "array",
@@ -78,7 +92,7 @@
78
92
  "input": {
79
93
  "type": "string",
80
94
  "description": "The file to include.",
81
- "pattern": "\\.(?:css|scss|sass|less|styl)$"
95
+ "pattern": "\\.(?:css|scss|sass|less)$"
82
96
  },
83
97
  "bundleName": {
84
98
  "type": "string",
@@ -99,7 +113,7 @@
99
113
  {
100
114
  "type": "string",
101
115
  "description": "The file to include.",
102
- "pattern": "\\.(?:css|scss|sass|less|styl)$"
116
+ "pattern": "\\.(?:css|scss|sass|less)$"
103
117
  }
104
118
  ]
105
119
  }
@@ -135,6 +149,9 @@
135
149
  "items": {
136
150
  "type": "string"
137
151
  },
152
+ "default": [
153
+ "**/*.spec.ts"
154
+ ],
138
155
  "description": "Globs of files to include, relative to workspace or project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead."
139
156
  },
140
157
  "sourceMap": {
@@ -303,9 +320,7 @@
303
320
  },
304
321
  "additionalProperties": false,
305
322
  "required": [
306
- "main",
307
- "tsConfig",
308
- "karmaConfig"
323
+ "tsConfig"
309
324
  ],
310
325
  "definitions": {
311
326
  "assetPattern": {
@@ -41,8 +41,8 @@
41
41
  },
42
42
  "optimization": {
43
43
  "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.",
44
- "x-user-analytics": 16,
45
44
  "default": true,
45
+ "x-user-analytics": "ep.ng_optimization",
46
46
  "oneOf": [
47
47
  {
48
48
  "type": "object",
@@ -121,6 +121,11 @@
121
121
  "description": "URL where files will be deployed.",
122
122
  "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."
123
123
  },
124
+ "vendorChunk": {
125
+ "type": "boolean",
126
+ "description": "Generate a seperate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
127
+ "default": false
128
+ },
124
129
  "verbose": {
125
130
  "type": "boolean",
126
131
  "description": "Adds more details to output logging.",
@@ -199,22 +204,6 @@
199
204
  "description": "Use file name for lazy loaded chunks.",
200
205
  "default": false
201
206
  },
202
- "bundleDependencies": {
203
- "description": "Which external dependencies to bundle into the bundle. By default, all of node_modules will be bundled.",
204
- "default": true,
205
- "oneOf": [
206
- {
207
- "type": "boolean"
208
- },
209
- {
210
- "type": "string",
211
- "enum": [
212
- "none",
213
- "all"
214
- ]
215
- }
216
- ]
217
- },
218
207
  "externalDependencies": {
219
208
  "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.",
220
209
  "type": "array",
package/dist/utils.js CHANGED
@@ -25,8 +25,7 @@ const _tsNodeRegister = (() => {
25
25
  return;
26
26
  }
27
27
  lastTsConfig = tsConfig;
28
- // Register ts-node
29
- require('ts-node').register({
28
+ loadTsNode().register({
30
29
  project: tsConfig,
31
30
  compilerOptions: {
32
31
  module: 'CommonJS',
@@ -35,11 +34,15 @@ const _tsNodeRegister = (() => {
35
34
  ],
36
35
  },
37
36
  });
38
- // Register paths in tsConfig
39
- const tsconfigPaths = require('tsconfig-paths');
40
- const { absoluteBaseUrl: baseUrl, paths } = tsconfigPaths.loadConfig(tsConfig);
41
- if (baseUrl && paths) {
42
- tsconfigPaths.register({ baseUrl, paths });
37
+ const tsConfigPaths = loadTsConfigPaths();
38
+ const result = tsConfigPaths.loadConfig(tsConfig);
39
+ // The `loadConfig` returns a `ConfigLoaderResult` which must be guarded with
40
+ // the `resultType` check.
41
+ if (result.resultType === 'success') {
42
+ const { absoluteBaseUrl: baseUrl, paths } = result;
43
+ if (baseUrl && paths) {
44
+ tsConfigPaths.register({ baseUrl, paths });
45
+ }
43
46
  }
44
47
  };
45
48
  })();
@@ -49,7 +52,7 @@ const _tsNodeRegister = (() => {
49
52
  * @todo tsNodeRegistration: require ts-node if file extension is TypeScript
50
53
  */
51
54
  function tsNodeRegister(file = '', tsConfig, logger) {
52
- if (file && file.endsWith('.ts')) {
55
+ if (file === null || file === void 0 ? void 0 : file.endsWith('.ts')) {
53
56
  // Register TS compiler lazily
54
57
  _tsNodeRegister(tsConfig, logger);
55
58
  }
@@ -121,4 +124,18 @@ function loadModule(path) {
121
124
  });
122
125
  }
123
126
  exports.loadModule = loadModule;
127
+ /**
128
+ * Loads `ts-node` lazily. Moved to a separate function to declare
129
+ * a return type, more readable than an inline variant.
130
+ */
131
+ function loadTsNode() {
132
+ return require('ts-node');
133
+ }
134
+ /**
135
+ * Loads `tsconfig-paths` lazily. Moved to a separate function to declare
136
+ * a return type, more readable than an inline variant.
137
+ */
138
+ function loadTsConfigPaths() {
139
+ return require('tsconfig-paths');
140
+ }
124
141
  //# sourceMappingURL=utils.js.map
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+BAA+B;AAC/B,6BAAoC;AAEpC,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE;IAC5B,IAAI,YAAgC,CAAC;IACrC,OAAO,CAAC,QAAgB,EAAE,MAAyB,EAAE,EAAE;QACrD,qEAAqE;QACrE,IAAI,YAAY,IAAI,YAAY,KAAK,QAAQ,EAAE;YAC7C,MAAM,CAAC,IAAI,CAAC;iCACe,YAAY;iCACZ,QAAQ,EAAE,CAAC,CAAC;SACxC;QAED,IAAI,YAAY,EAAE;YAChB,OAAO;SACR;QAED,YAAY,GAAG,QAAQ,CAAC;QAExB,mBAAmB;QACnB,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC;YAC1B,OAAO,EAAE,QAAQ;YACjB,eAAe,EAAE;gBACf,MAAM,EAAE,UAAU;gBAClB,KAAK,EAAE;oBACL,MAAM,EAAE,qGAAqG;iBAC9G;aACF;SACF,CAAC,CAAC;QAEH,6BAA6B;QAC7B,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAChD,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,UAAU,CAAC,QAA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OAAO,CAAM,EAAE;oBACf,IAAI,CAAC,CAAC,IAAI,KAAK,iBAAiB,EAAE;wBAChC,kFAAkF;wBAClF,yFAAyF;wBACzF,sCAAsC;wBACtC,OAAO,CAAC,MAAM,aAAa,CAAiB,IAAA,mBAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;qBAC3E;oBACD,MAAM,CAAC,CAAC;iBACT;YACH,KAAK;YACL;gBACE,4CAA4C;gBAC5C,qDAAqD;gBACrD,IAAI;oBACF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;iBACtB;gBAAC,OAAO,CAAM,EAAE;oBACf,IAAI,CAAC,CAAC,IAAI,KAAK,iBAAiB,EAAE;wBAChC,kFAAkF;wBAClF,yFAAyF;wBACzF,sCAAsC;wBACtC,OAAO,CAAC,MAAM,aAAa,CAAiB,IAAA,mBAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;qBAC3E;oBAED,MAAM,CAAC,CAAC;iBACT;SACJ;IACH,CAAC;CAAA;AAzCD,gCAyCC;AAED;;;GAGG;AACH,SAAS,UAAU;IACjB,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB;IACxB,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-builders/custom-webpack",
3
- "version": "14.1.0",
3
+ "version": "15.0.0-beta.0",
4
4
  "description": "Custom webpack builders for Angular build facade. Allow to modify Angular build configuration without ejecting it",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -18,7 +18,7 @@
18
18
  "author": "JeB Barabanov",
19
19
  "license": "MIT",
20
20
  "engines": {
21
- "node": "^14.15.0 || >=16.10.0"
21
+ "node": "^14.20.0 || ^16.13.0 || >=18.10.0"
22
22
  },
23
23
  "keywords": [
24
24
  "cli",
@@ -40,21 +40,21 @@
40
40
  },
41
41
  "builders": "builders.json",
42
42
  "dependencies": {
43
- "@angular-devkit/architect": ">=0.1400.0 < 0.1500.0",
44
- "@angular-devkit/build-angular": "^14.0.0",
45
- "@angular-devkit/core": "^14.0.0",
43
+ "@angular-devkit/architect": ">=0.1500.0 < 0.1600.0",
44
+ "@angular-devkit/build-angular": "^15.0.0",
45
+ "@angular-devkit/core": "^15.0.0",
46
46
  "lodash": "^4.17.15",
47
47
  "ts-node": "^10.0.0",
48
- "tsconfig-paths": "^3.9.0",
48
+ "tsconfig-paths": "^4.1.0",
49
49
  "webpack-merge": "^5.7.3"
50
50
  },
51
51
  "peerDependencies": {
52
- "@angular/compiler-cli": "^14.0.0"
52
+ "@angular/compiler-cli": "^15.0.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "jest": "28.1.3",
56
56
  "rimraf": "^3.0.2",
57
- "typescript": "4.7.4"
57
+ "typescript": "4.8.2"
58
58
  },
59
- "gitHead": "686a75c3d29bbc84850895df59e77b2293b47113"
59
+ "gitHead": "bfab72d35a4c19de28ba1e56a56bf399f5a44be6"
60
60
  }