@angular-builders/custom-webpack 17.0.1-beta.0 → 17.0.1-beta.1
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/dist/browser/schema.json +1 -1
- package/dist/custom-webpack-builder.js +6 -11
- package/dist/custom-webpack-builder.js.map +1 -1
- package/dist/karma/schema.json +12 -2
- package/dist/transform-factories.js +7 -5
- package/dist/transform-factories.js.map +1 -1
- package/package.json +4 -4
- package/dist/utils.d.ts +0 -13
- package/dist/utils.js +0 -141
- package/dist/utils.js.map +0 -1
package/dist/browser/schema.json
CHANGED
|
@@ -445,7 +445,7 @@
|
|
|
445
445
|
]
|
|
446
446
|
},
|
|
447
447
|
"allowedCommonJsDependencies": {
|
|
448
|
-
"description": "A list of CommonJS packages that are allowed to be used without a build time warning.",
|
|
448
|
+
"description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all.",
|
|
449
449
|
"type": "array",
|
|
450
450
|
"items": {
|
|
451
451
|
"type": "string"
|
|
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CustomWebpackBuilder = exports.defaultWebpackConfigPath = void 0;
|
|
13
|
+
const path = require("node:path");
|
|
13
14
|
const util_1 = require("util");
|
|
14
15
|
const core_1 = require("@angular-devkit/core");
|
|
15
16
|
const lodash_1 = require("lodash");
|
|
16
|
-
const
|
|
17
|
+
const common_1 = require("@angular-builders/common");
|
|
17
18
|
const webpack_config_merger_1 = require("./webpack-config-merger");
|
|
18
19
|
exports.defaultWebpackConfigPath = 'webpack.config.js';
|
|
19
20
|
class CustomWebpackBuilder {
|
|
@@ -22,10 +23,10 @@ class CustomWebpackBuilder {
|
|
|
22
23
|
if (!config) {
|
|
23
24
|
return baseWebpackConfig;
|
|
24
25
|
}
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const configOrFactoryOrPromise = yield
|
|
26
|
+
const normalizedRootPath = (0, core_1.getSystemPath)(root);
|
|
27
|
+
const tsConfig = path.join(normalizedRootPath, buildOptions.tsConfig);
|
|
28
|
+
const webpackConfigPath = path.join(normalizedRootPath, config.path || exports.defaultWebpackConfigPath);
|
|
29
|
+
const configOrFactoryOrPromise = yield (0, common_1.loadModule)(webpackConfigPath, tsConfig, logger);
|
|
29
30
|
if (typeof configOrFactoryOrPromise === 'function') {
|
|
30
31
|
// The exported function can return a new configuration synchronously
|
|
31
32
|
// or return a promise that resolves to a new configuration.
|
|
@@ -47,12 +48,6 @@ class CustomWebpackBuilder {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
exports.CustomWebpackBuilder = CustomWebpackBuilder;
|
|
50
|
-
function resolveCustomWebpackConfig(path, tsConfig, logger) {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
(0, utils_1.tsNodeRegister)(path, tsConfig, logger);
|
|
53
|
-
return (0, utils_1.loadModule)(path);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
51
|
function logConfigProperties(config, webpackConfig, logger) {
|
|
57
52
|
var _a;
|
|
58
53
|
// There's no reason to log the entire configuration object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-webpack-builder.js","sourceRoot":"","sources":["../src/custom-webpack-builder.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA+B;AAC/B,+CAAoE;AACpE,mCAA6B;
|
|
1
|
+
{"version":3,"file":"custom-webpack-builder.js","sourceRoot":"","sources":["../src/custom-webpack-builder.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kCAAkC;AAClC,+BAA+B;AAC/B,+CAAoE;AACpE,mCAA6B;AAE7B,qDAAsD;AAKtD,mEAAuD;AAE1C,QAAA,wBAAwB,GAAG,mBAAmB,CAAC;AAgB5D,MAAa,oBAAoB;IAC/B,MAAM,CA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,MAAkC,EAClC,aAA4B,EAC5B,MAAyB;;IAEzB,2DAA2D;IAC3D,2DAA2D;IAC3D,4DAA4D;IAC5D,2EAA2E;IAC3E,IAAI,MAAA,MAAM,CAAC,OAAO,0CAAE,UAAU,EAAE,CAAC;QAC/B,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACjD,MAAM,KAAK,GAAG,IAAA,YAAG,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;YAC3C,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,OAAO,GAAG,IAAA,cAAO,EAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;gBAC1F,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/karma/schema.json
CHANGED
|
@@ -210,8 +210,18 @@
|
|
|
210
210
|
"description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
|
|
211
211
|
},
|
|
212
212
|
"browsers": {
|
|
213
|
-
"
|
|
214
|
-
"
|
|
213
|
+
"description": "Override which browsers tests are run against. Set to `false` to not use any browser.",
|
|
214
|
+
"oneOf": [
|
|
215
|
+
{
|
|
216
|
+
"type": "string",
|
|
217
|
+
"description": "A comma seperate list of browsers to run tests against."
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"const": false,
|
|
221
|
+
"type": "boolean",
|
|
222
|
+
"description": "Does use run tests against a browser."
|
|
223
|
+
}
|
|
224
|
+
]
|
|
215
225
|
},
|
|
216
226
|
"codeCoverage": {
|
|
217
227
|
"type": "boolean",
|
|
@@ -10,19 +10,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getTransforms = exports.indexHtmlTransformFactory = exports.customWebpackConfigTransformFactory = void 0;
|
|
13
|
+
const path = require("node:path");
|
|
13
14
|
const core_1 = require("@angular-devkit/core");
|
|
15
|
+
const common_1 = require("@angular-builders/common");
|
|
14
16
|
const custom_webpack_builder_1 = require("./custom-webpack-builder");
|
|
15
|
-
const utils_1 = require("./utils");
|
|
16
17
|
const customWebpackConfigTransformFactory = (options, { workspaceRoot, target, logger }) => browserWebpackConfig => {
|
|
17
18
|
return custom_webpack_builder_1.CustomWebpackBuilder.buildWebpackConfig((0, core_1.normalize)(workspaceRoot), options.customWebpackConfig, browserWebpackConfig, options, target, logger);
|
|
18
19
|
};
|
|
19
20
|
exports.customWebpackConfigTransformFactory = customWebpackConfigTransformFactory;
|
|
20
|
-
const indexHtmlTransformFactory = (
|
|
21
|
-
if (!indexTransform)
|
|
21
|
+
const indexHtmlTransformFactory = (options, { workspaceRoot, target, logger }) => {
|
|
22
|
+
if (!options.indexTransform)
|
|
22
23
|
return null;
|
|
23
|
-
|
|
24
|
+
const transformPath = path.join((0, core_1.getSystemPath)((0, core_1.normalize)(workspaceRoot)), options.indexTransform);
|
|
25
|
+
const tsConfig = path.join((0, core_1.getSystemPath)((0, core_1.normalize)(workspaceRoot)), options.tsConfig);
|
|
24
26
|
return (indexHtml) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
-
const transform = yield (0,
|
|
27
|
+
const transform = yield (0, common_1.loadModule)(transformPath, tsConfig, logger);
|
|
26
28
|
return transform(target, indexHtml);
|
|
27
29
|
});
|
|
28
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-factories.js","sourceRoot":"","sources":["../src/transform-factories.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"transform-factories.js","sourceRoot":"","sources":["../src/transform-factories.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kCAAkC;AAIlC,+CAAgE;AAEhE,qDAAsD;AAEtD,qEAAgE;A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CAAC;CACvD,CAAC,CAAC;AAHU,QAAA,aAAa,iBAGvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-builders/custom-webpack",
|
|
3
|
-
"version": "17.0.1-beta.
|
|
3
|
+
"version": "17.0.1-beta.1",
|
|
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": [
|
|
@@ -40,12 +40,11 @@
|
|
|
40
40
|
},
|
|
41
41
|
"builders": "builders.json",
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@angular-builders/common": "1.0.1-beta.0",
|
|
43
44
|
"@angular-devkit/architect": ">=0.1700.0 < 0.1800.0",
|
|
44
45
|
"@angular-devkit/build-angular": "^17.0.0",
|
|
45
46
|
"@angular-devkit/core": "^17.0.0",
|
|
46
47
|
"lodash": "^4.17.15",
|
|
47
|
-
"ts-node": "^10.0.0",
|
|
48
|
-
"tsconfig-paths": "^4.1.0",
|
|
49
48
|
"webpack-merge": "^5.7.3"
|
|
50
49
|
},
|
|
51
50
|
"peerDependencies": {
|
|
@@ -54,7 +53,8 @@
|
|
|
54
53
|
"devDependencies": {
|
|
55
54
|
"jest": "29.7.0",
|
|
56
55
|
"rimraf": "^5.0.0",
|
|
56
|
+
"ts-node": "^10.0.0",
|
|
57
57
|
"typescript": "5.3.3"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "3b194f1b596aee0c50a5578a89977f389f2612c0"
|
|
60
60
|
}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { logging } from '@angular-devkit/core';
|
|
2
|
-
/**
|
|
3
|
-
* check for TS node registration
|
|
4
|
-
* @param file: file name or file directory are allowed
|
|
5
|
-
* @todo tsNodeRegistration: require ts-node if file extension is TypeScript
|
|
6
|
-
*/
|
|
7
|
-
export declare function tsNodeRegister(file: string, tsConfig: string, logger: logging.LoggerApi): void;
|
|
8
|
-
/**
|
|
9
|
-
* Loads CJS and ESM modules based on extension
|
|
10
|
-
* @param path path to the module
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare function loadModule<T>(path: string): Promise<T>;
|
package/dist/utils.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.loadModule = exports.tsNodeRegister = void 0;
|
|
13
|
-
const path_1 = require("path");
|
|
14
|
-
const url_1 = require("url");
|
|
15
|
-
const _tsNodeRegister = (() => {
|
|
16
|
-
let lastTsConfig;
|
|
17
|
-
return (tsConfig, logger) => {
|
|
18
|
-
// Check if the function was previously called with the same tsconfig
|
|
19
|
-
if (lastTsConfig && lastTsConfig !== tsConfig) {
|
|
20
|
-
logger.warn(`Trying to register ts-node again with a different tsconfig - skipping the registration.
|
|
21
|
-
tsconfig 1: ${lastTsConfig}
|
|
22
|
-
tsconfig 2: ${tsConfig}`);
|
|
23
|
-
}
|
|
24
|
-
if (lastTsConfig) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
lastTsConfig = tsConfig;
|
|
28
|
-
loadTsNode().register({
|
|
29
|
-
project: tsConfig,
|
|
30
|
-
compilerOptions: {
|
|
31
|
-
module: 'CommonJS',
|
|
32
|
-
types: [
|
|
33
|
-
'node', // NOTE: `node` is added because users scripts can also use pure node's packages as webpack or others
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
});
|
|
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
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
})();
|
|
49
|
-
/**
|
|
50
|
-
* check for TS node registration
|
|
51
|
-
* @param file: file name or file directory are allowed
|
|
52
|
-
* @todo tsNodeRegistration: require ts-node if file extension is TypeScript
|
|
53
|
-
*/
|
|
54
|
-
function tsNodeRegister(file = '', tsConfig, logger) {
|
|
55
|
-
if (file === null || file === void 0 ? void 0 : file.endsWith('.ts')) {
|
|
56
|
-
// Register TS compiler lazily
|
|
57
|
-
_tsNodeRegister(tsConfig, logger);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.tsNodeRegister = tsNodeRegister;
|
|
61
|
-
/**
|
|
62
|
-
* This uses a dynamic import to load a module which may be ESM.
|
|
63
|
-
* CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
|
|
64
|
-
* will currently, unconditionally downlevel dynamic import into a require call.
|
|
65
|
-
* require calls cannot load ESM code and will result in a runtime error. To workaround
|
|
66
|
-
* this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
|
|
67
|
-
* Once TypeScript provides support for keeping the dynamic import this workaround can
|
|
68
|
-
* be dropped.
|
|
69
|
-
*
|
|
70
|
-
* @param modulePath The path of the module to load.
|
|
71
|
-
* @returns A Promise that resolves to the dynamically imported module.
|
|
72
|
-
*/
|
|
73
|
-
function loadEsmModule(modulePath) {
|
|
74
|
-
return new Function('modulePath', `return import(modulePath);`)(modulePath);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Loads CJS and ESM modules based on extension
|
|
78
|
-
* @param path path to the module
|
|
79
|
-
* @returns
|
|
80
|
-
*/
|
|
81
|
-
function loadModule(path) {
|
|
82
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
switch ((0, path_1.extname)(path)) {
|
|
84
|
-
case '.mjs':
|
|
85
|
-
// Load the ESM configuration file using the TypeScript dynamic import workaround.
|
|
86
|
-
// Once TypeScript provides support for keeping the dynamic import this workaround can be
|
|
87
|
-
// changed to a direct dynamic import.
|
|
88
|
-
return (yield loadEsmModule((0, url_1.pathToFileURL)(path))).default;
|
|
89
|
-
case '.cjs':
|
|
90
|
-
return require(path);
|
|
91
|
-
case '.ts':
|
|
92
|
-
try {
|
|
93
|
-
// If it's a TS file then there are 2 cases for exporing an object.
|
|
94
|
-
// The first one is `export blah`, transpiled into `module.exports = { blah} `.
|
|
95
|
-
// The second is `export default blah`, transpiled into `{ default: { ... } }`.
|
|
96
|
-
return require(path).default || require(path);
|
|
97
|
-
}
|
|
98
|
-
catch (e) {
|
|
99
|
-
if (e.code === 'ERR_REQUIRE_ESM') {
|
|
100
|
-
// Load the ESM configuration file using the TypeScript dynamic import workaround.
|
|
101
|
-
// Once TypeScript provides support for keeping the dynamic import this workaround can be
|
|
102
|
-
// changed to a direct dynamic import.
|
|
103
|
-
return (yield loadEsmModule((0, url_1.pathToFileURL)(path))).default;
|
|
104
|
-
}
|
|
105
|
-
throw e;
|
|
106
|
-
}
|
|
107
|
-
//.js
|
|
108
|
-
default:
|
|
109
|
-
// The file could be either CommonJS or ESM.
|
|
110
|
-
// CommonJS is tried first then ESM if loading fails.
|
|
111
|
-
try {
|
|
112
|
-
return require(path);
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
if (e.code === 'ERR_REQUIRE_ESM') {
|
|
116
|
-
// Load the ESM configuration file using the TypeScript dynamic import workaround.
|
|
117
|
-
// Once TypeScript provides support for keeping the dynamic import this workaround can be
|
|
118
|
-
// changed to a direct dynamic import.
|
|
119
|
-
return (yield loadEsmModule((0, url_1.pathToFileURL)(path))).default;
|
|
120
|
-
}
|
|
121
|
-
throw e;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}
|
|
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
|
-
}
|
|
141
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,CAAC;YAC9C,MAAM,CAAC,IAAI,CAAC;iCACe,YAAY;iCACZ,QAAQ,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,YAAY,GAAG,QAAQ,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