@angular-builders/custom-webpack 21.1.0-beta.0 → 21.1.0-beta.2
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/index.d.ts +8 -0
- package/dist/browser/index.js +10 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/schema.json +648 -0
- package/dist/custom-webpack-builder-config.d.ts +11 -0
- package/dist/custom-webpack-builder-config.js +3 -0
- package/dist/custom-webpack-builder-config.js.map +1 -0
- package/dist/custom-webpack-builder.d.ts +8 -0
- package/dist/custom-webpack-builder.js +88 -0
- package/dist/custom-webpack-builder.js.map +1 -0
- package/dist/custom-webpack-schema.d.ts +6 -0
- package/dist/custom-webpack-schema.js +3 -0
- package/dist/custom-webpack-schema.js.map +1 -0
- package/dist/dev-server/index.d.ts +4 -0
- package/dist/dev-server/index.js +7 -0
- package/dist/dev-server/index.js.map +1 -0
- package/dist/dev-server/schema.json +146 -0
- package/dist/extract-i18n/index.d.ts +6 -0
- package/dist/extract-i18n/index.js +7 -0
- package/dist/extract-i18n/index.js.map +1 -0
- package/dist/extract-i18n/schema.json +53 -0
- package/dist/generic-browser-builder.d.ts +13 -0
- package/dist/generic-browser-builder.js +16 -0
- package/dist/generic-browser-builder.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/karma/index.d.ts +11 -0
- package/dist/karma/index.js +15 -0
- package/dist/karma/index.js.map +1 -0
- package/dist/karma/schema.json +398 -0
- package/dist/server/index.d.ts +11 -0
- package/dist/server/index.js +15 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/schema.json +380 -0
- package/dist/transform-factories.d.ts +11 -0
- package/dist/transform-factories.js +61 -0
- package/dist/transform-factories.js.map +1 -0
- package/dist/type-definition.d.ts +3 -0
- package/dist/type-definition.js +3 -0
- package/dist/type-definition.js.map +1 -0
- package/dist/webpack-config-merger.d.ts +3 -0
- package/dist/webpack-config-merger.js +29 -0
- package/dist/webpack-config-merger.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { logging, Path } from '@angular-devkit/core';
|
|
2
|
+
import { Configuration } from 'webpack';
|
|
3
|
+
import { CustomWebpackBuilderConfig } from './custom-webpack-builder-config';
|
|
4
|
+
import { TargetOptions } from './type-definition';
|
|
5
|
+
export declare const defaultWebpackConfigPath = "webpack.config.js";
|
|
6
|
+
export declare class CustomWebpackBuilder {
|
|
7
|
+
static buildWebpackConfig(root: Path, config: CustomWebpackBuilderConfig | null, baseWebpackConfig: Configuration, buildOptions: any, targetOptions: TargetOptions, logger: logging.LoggerApi): Promise<Configuration>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CustomWebpackBuilder = exports.defaultWebpackConfigPath = void 0;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const util_1 = require("util");
|
|
39
|
+
const core_1 = require("@angular-devkit/core");
|
|
40
|
+
const lodash_1 = require("lodash");
|
|
41
|
+
const common_1 = require("@angular-builders/common");
|
|
42
|
+
const webpack_config_merger_1 = require("./webpack-config-merger");
|
|
43
|
+
exports.defaultWebpackConfigPath = 'webpack.config.js';
|
|
44
|
+
class CustomWebpackBuilder {
|
|
45
|
+
static async buildWebpackConfig(root, config, baseWebpackConfig, buildOptions, targetOptions, logger) {
|
|
46
|
+
if (!config) {
|
|
47
|
+
return baseWebpackConfig;
|
|
48
|
+
}
|
|
49
|
+
const normalizedRootPath = (0, core_1.getSystemPath)(root);
|
|
50
|
+
const tsConfig = path.join(normalizedRootPath, buildOptions.tsConfig);
|
|
51
|
+
const webpackConfigPath = path.join(normalizedRootPath, config.path || exports.defaultWebpackConfigPath);
|
|
52
|
+
const configOrFactoryOrPromise = await (0, common_1.loadModule)(webpackConfigPath, tsConfig, logger);
|
|
53
|
+
if (typeof configOrFactoryOrPromise === 'function') {
|
|
54
|
+
// The exported function can return a new configuration synchronously
|
|
55
|
+
// or return a promise that resolves to a new configuration.
|
|
56
|
+
const finalWebpackConfig = await configOrFactoryOrPromise(baseWebpackConfig, buildOptions, targetOptions);
|
|
57
|
+
logConfigProperties(config, finalWebpackConfig, logger);
|
|
58
|
+
return finalWebpackConfig;
|
|
59
|
+
}
|
|
60
|
+
// The user can also export a promise that resolves to a `Configuration` object.
|
|
61
|
+
// Suppose the following example:
|
|
62
|
+
// `module.exports = new Promise(resolve => resolve({ ... }))`
|
|
63
|
+
// This is valid both for promise and non-promise cases. If users export
|
|
64
|
+
// a plain object, for instance, `module.exports = { ... }`, then it will
|
|
65
|
+
// be wrapped into a promise and also `awaited`.
|
|
66
|
+
const resolvedConfig = await configOrFactoryOrPromise;
|
|
67
|
+
const finalWebpackConfig = (0, webpack_config_merger_1.mergeConfigs)(baseWebpackConfig, resolvedConfig, config.mergeRules, config.replaceDuplicatePlugins);
|
|
68
|
+
logConfigProperties(config, finalWebpackConfig, logger);
|
|
69
|
+
return finalWebpackConfig;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.CustomWebpackBuilder = CustomWebpackBuilder;
|
|
73
|
+
function logConfigProperties(config, webpackConfig, logger) {
|
|
74
|
+
// There's no reason to log the entire configuration object
|
|
75
|
+
// since Angular's Webpack configuration is huge by default
|
|
76
|
+
// and doesn't bring any meaningful context by being printed
|
|
77
|
+
// entirely. Users can provide a list of properties they want to be logged.
|
|
78
|
+
if (config.verbose?.properties) {
|
|
79
|
+
for (const property of config.verbose.properties) {
|
|
80
|
+
const value = (0, lodash_1.get)(webpackConfig, property);
|
|
81
|
+
if (value) {
|
|
82
|
+
const message = (0, util_1.inspect)(value, /* showHidden */ false, config.verbose.serializationDepth);
|
|
83
|
+
logger.info(message);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=custom-webpack-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-webpack-builder.js","sourceRoot":"","sources":["../src/custom-webpack-builder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,+BAA+B;AAC/B,+CAAoE;AACpE,mCAA6B;AAE7B,qDAAsD;AAKtD,mEAAuD;AAE1C,QAAA,wBAAwB,GAAG,mBAAmB,CAAC;AAgB5D,MAAa,oBAAoB;IAC/B,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAC7B,IAAU,EACV,MAAyC,EACzC,iBAAgC,EAChC,YAAiB,EACjB,aAA4B,EAC5B,MAAyB;QAEzB,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QAED,MAAM,kBAAkB,GAAG,IAAA,oBAAa,EAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QACtE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CACjC,kBAAkB,EAClB,MAAM,CAAC,IAAI,IAAI,gCAAwB,CACxC,CAAC;QACF,MAAM,wBAAwB,GAAG,MAAM,IAAA,mBAAU,EAC/C,iBAAiB,EACjB,QAAQ,EACR,MAAM,CACP,CAAC;QAEF,IAAI,OAAO,wBAAwB,KAAK,UAAU,EAAE,CAAC;YACnD,qEAAqE;YACrE,4DAA4D;YAC5D,MAAM,kBAAkB,GAAG,MAAM,wBAAwB,CACvD,iBAAiB,EACjB,YAAY,EACZ,aAAa,CACd,CAAC;YACF,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;YACxD,OAAO,kBAAkB,CAAC;QAC5B,CAAC;QAED,gFAAgF;QAChF,iCAAiC;QACjC,8DAA8D;QAC9D,wEAAwE;QACxE,yEAAyE;QACzE,gDAAgD;QAChD,MAAM,cAAc,GAAG,MAAM,wBAAwB,CAAC;QAEtD,MAAM,kBAAkB,GAAG,IAAA,oCAAY,EACrC,iBAAiB,EACjB,cAAc,EACd,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,uBAAuB,CAC/B,CAAC;QACF,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;QACxD,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AAtDD,oDAsDC;AAED,SAAS,mBAAmB,CAC1B,MAAkC,EAClC,aAA4B,EAC5B,MAAyB;IAEzB,2DAA2D;IAC3D,2DAA2D;IAC3D,4DAA4D;IAC5D,2EAA2E;IAC3E,IAAI,MAAM,CAAC,OAAO,EAAE,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-webpack-schema.js","sourceRoot":"","sources":["../src/custom-webpack-schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
4
|
+
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
5
|
+
const generic_browser_builder_1 = require("../generic-browser-builder");
|
|
6
|
+
exports.default = (0, architect_1.createBuilder)((0, generic_browser_builder_1.executeBrowserBasedBuilder)(build_angular_1.executeDevServerBuilder));
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dev-server/index.ts"],"names":[],"mappings":";;AAAA,yDAA0D;AAC1D,iEAAiG;AAEjG,wEAAwE;AAExE,kBAAe,IAAA,yBAAa,EAC1B,IAAA,oDAA0B,EAAC,uCAAuB,CAAC,CACpD,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"title": "Custom webpack dev server schema for Angular build facade",
|
|
4
|
+
"description": "Dev server target options",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"buildTarget": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
|
|
10
|
+
"pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$"
|
|
11
|
+
},
|
|
12
|
+
"port": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"description": "Port to listen on.",
|
|
15
|
+
"default": 4200
|
|
16
|
+
},
|
|
17
|
+
"host": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Host to listen on.",
|
|
20
|
+
"default": "localhost"
|
|
21
|
+
},
|
|
22
|
+
"proxyConfig": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Proxy configuration file. For more information, see https://angular.dev/tools/cli/serve#proxying-to-a-backend-server."
|
|
25
|
+
},
|
|
26
|
+
"ssl": {
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"description": "Serve using HTTPS.",
|
|
29
|
+
"default": false
|
|
30
|
+
},
|
|
31
|
+
"sslKey": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "SSL key to use for serving HTTPS."
|
|
34
|
+
},
|
|
35
|
+
"sslCert": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "SSL certificate to use for serving HTTPS."
|
|
38
|
+
},
|
|
39
|
+
"headers": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"description": "Custom HTTP headers to be added to all responses.",
|
|
42
|
+
"propertyNames": {
|
|
43
|
+
"pattern": "^[-_A-Za-z0-9]+$"
|
|
44
|
+
},
|
|
45
|
+
"additionalProperties": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"open": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"description": "Opens the url in default browser.",
|
|
52
|
+
"default": false,
|
|
53
|
+
"alias": "o"
|
|
54
|
+
},
|
|
55
|
+
"verbose": {
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"description": "Adds more details to output logging."
|
|
58
|
+
},
|
|
59
|
+
"liveReload": {
|
|
60
|
+
"type": "boolean",
|
|
61
|
+
"description": "Whether to reload the page on change, using live-reload.",
|
|
62
|
+
"default": true
|
|
63
|
+
},
|
|
64
|
+
"publicHost": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies. This option has no effect when using the 'application' or other esbuild-based builders."
|
|
67
|
+
},
|
|
68
|
+
"allowedHosts": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"description": "List of hosts that are allowed to access the dev server.",
|
|
71
|
+
"default": [],
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"servePath": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The pathname where the application will be served."
|
|
79
|
+
},
|
|
80
|
+
"disableHostCheck": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"description": "Don't verify connected clients are part of allowed hosts.",
|
|
83
|
+
"default": false
|
|
84
|
+
},
|
|
85
|
+
"hmr": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"description": "Enable hot module replacement."
|
|
88
|
+
},
|
|
89
|
+
"watch": {
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"description": "Rebuild on change.",
|
|
92
|
+
"default": true
|
|
93
|
+
},
|
|
94
|
+
"poll": {
|
|
95
|
+
"type": "number",
|
|
96
|
+
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
97
|
+
},
|
|
98
|
+
"inspect": {
|
|
99
|
+
"default": false,
|
|
100
|
+
"description": "Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are enabled.",
|
|
101
|
+
"oneOf": [
|
|
102
|
+
{
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "Activate the inspector on host and port in the format of `[[host:]port]`. See the security warning in https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure regarding the host parameter usage."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "boolean"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"forceEsbuild": {
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"description": "Force the development server to use the 'browser-esbuild' builder when building.",
|
|
114
|
+
"default": false
|
|
115
|
+
},
|
|
116
|
+
"prebundle": {
|
|
117
|
+
"description": "Enable and control the Vite-based development server's prebundling capabilities. To enable prebundling, the Angular CLI cache must also be enabled. This option has no effect when using the 'browser' or other Webpack-based builders.",
|
|
118
|
+
"oneOf": [
|
|
119
|
+
{
|
|
120
|
+
"type": "boolean"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"type": "object",
|
|
124
|
+
"properties": {
|
|
125
|
+
"exclude": {
|
|
126
|
+
"description": "List of package imports that should not be prebundled by the development server. The packages will be bundled into the application code itself.",
|
|
127
|
+
"type": "array",
|
|
128
|
+
"items": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"additionalProperties": false,
|
|
134
|
+
"required": [
|
|
135
|
+
"exclude"
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": false,
|
|
142
|
+
"required": [
|
|
143
|
+
"buildTarget"
|
|
144
|
+
],
|
|
145
|
+
"$id": "CustomWebpackDevServerSchema"
|
|
146
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExtractI18nBuilderOptions } from '@angular-devkit/build-angular';
|
|
2
|
+
import { json } from '@angular-devkit/core';
|
|
3
|
+
declare const _default: import("@angular-devkit/architect").Builder<ExtractI18nBuilderOptions & json.JsonObject & {
|
|
4
|
+
buildTarget: string;
|
|
5
|
+
}>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
4
|
+
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
5
|
+
const generic_browser_builder_1 = require("../generic-browser-builder");
|
|
6
|
+
exports.default = (0, architect_1.createBuilder)((0, generic_browser_builder_1.executeBrowserBasedBuilder)(build_angular_1.executeExtractI18nBuilder));
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extract-i18n/index.ts"],"names":[],"mappings":";;AAAA,yDAA0D;AAC1D,iEAGuC;AAEvC,wEAAwE;AAKxE,kBAAe,IAAA,yBAAa,EAC1B,IAAA,oDAA0B,EAAC,yCAAyB,CAAC,CACtD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"title": "Custom webpack extract-i18n schema for Build Facade",
|
|
4
|
+
"description": "Extract i18n target options",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"buildTarget": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "A builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
|
|
10
|
+
"pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$"
|
|
11
|
+
},
|
|
12
|
+
"format": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Output format for the generated file.",
|
|
15
|
+
"default": "xlf",
|
|
16
|
+
"enum": [
|
|
17
|
+
"xmb",
|
|
18
|
+
"xlf",
|
|
19
|
+
"xlif",
|
|
20
|
+
"xliff",
|
|
21
|
+
"xlf2",
|
|
22
|
+
"xliff2",
|
|
23
|
+
"json",
|
|
24
|
+
"arb",
|
|
25
|
+
"legacy-migrate"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"progress": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Log progress to the console.",
|
|
31
|
+
"default": true
|
|
32
|
+
},
|
|
33
|
+
"outputPath": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Path where output will be placed."
|
|
36
|
+
},
|
|
37
|
+
"outFile": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Name of the file to output."
|
|
40
|
+
},
|
|
41
|
+
"i18nDuplicateTranslation": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "How to handle duplicate translations.",
|
|
44
|
+
"enum": [
|
|
45
|
+
"error",
|
|
46
|
+
"warning",
|
|
47
|
+
"ignore"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"$id": "BuildCustomWebpackExtractI18nSchema"
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BuilderContext, BuilderHandlerFn } from '@angular-devkit/architect';
|
|
2
|
+
import { ExecutionTransformer } from '@angular-devkit/build-angular';
|
|
3
|
+
import type { IndexHtmlTransform } from '@angular/build/private';
|
|
4
|
+
import { Configuration } from 'webpack';
|
|
5
|
+
import { json } from '@angular-devkit/core';
|
|
6
|
+
export interface BuildTargetOptions {
|
|
7
|
+
buildTarget: string;
|
|
8
|
+
}
|
|
9
|
+
export type BuilderExecutor<O extends BuildTargetOptions & json.JsonObject> = (options: O, context: BuilderContext, transforms?: {
|
|
10
|
+
webpackConfiguration?: ExecutionTransformer<Configuration>;
|
|
11
|
+
indexHtml?: IndexHtmlTransform;
|
|
12
|
+
}) => any;
|
|
13
|
+
export declare const executeBrowserBasedBuilder: <O extends BuildTargetOptions & json.JsonObject>(executebBuilder: BuilderExecutor<O>) => BuilderHandlerFn<O>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeBrowserBasedBuilder = void 0;
|
|
4
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
5
|
+
const rxjs_1 = require("rxjs");
|
|
6
|
+
const operators_1 = require("rxjs/operators");
|
|
7
|
+
const transform_factories_1 = require("./transform-factories");
|
|
8
|
+
const executeBrowserBasedBuilder = (executebBuilder) => (options, context) => {
|
|
9
|
+
async function setup() {
|
|
10
|
+
const browserTarget = (0, architect_1.targetFromTargetString)(options.buildTarget);
|
|
11
|
+
return context.getTargetOptions(browserTarget);
|
|
12
|
+
}
|
|
13
|
+
return (0, rxjs_1.from)(setup()).pipe((0, operators_1.switchMap)(customWebpackOptions => executebBuilder(options, context, (0, transform_factories_1.getTransforms)(customWebpackOptions, context))));
|
|
14
|
+
};
|
|
15
|
+
exports.executeBrowserBasedBuilder = executeBrowserBasedBuilder;
|
|
16
|
+
//# sourceMappingURL=generic-browser-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-browser-builder.js","sourceRoot":"","sources":["../src/generic-browser-builder.ts"],"names":[],"mappings":";;;AAAA,yDAImC;AAGnC,+BAA4B;AAC5B,8CAA2C;AAG3C,+DAAsD;AAgB/C,MAAM,0BAA0B,GACrC,CACE,eAAmC,EACd,EAAE,CACzB,CAAC,OAAU,EAAE,OAAuB,EAAsC,EAAE;IAC1E,KAAK,UAAU,KAAK;QAClB,MAAM,aAAa,GAAG,IAAA,kCAAsB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAClE,OAAO,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAmC,CAAC;IACnF,CAAC;IAED,OAAO,IAAA,WAAI,EAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CACvB,IAAA,qBAAS,EAAC,oBAAoB,CAAC,EAAE,CAC/B,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,IAAA,mCAAa,EAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAChF,CACF,CAAC;AACJ,CAAC,CAAC;AAfS,QAAA,0BAA0B,8BAenC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by Evgeny Barabanov on 01/07/2018.
|
|
3
|
+
*/
|
|
4
|
+
export * from './browser';
|
|
5
|
+
export * from './karma';
|
|
6
|
+
export * from './server';
|
|
7
|
+
export * from './dev-server';
|
|
8
|
+
export * from './extract-i18n';
|
|
9
|
+
export * from './transform-factories';
|
|
10
|
+
export * from './generic-browser-builder';
|
|
11
|
+
export { TargetOptions } from './type-definition';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Created by Evgeny Barabanov on 01/07/2018.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("./browser"), exports);
|
|
21
|
+
__exportStar(require("./karma"), exports);
|
|
22
|
+
__exportStar(require("./server"), exports);
|
|
23
|
+
__exportStar(require("./dev-server"), exports);
|
|
24
|
+
__exportStar(require("./extract-i18n"), exports);
|
|
25
|
+
__exportStar(require("./transform-factories"), exports);
|
|
26
|
+
__exportStar(require("./generic-browser-builder"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,+CAA6B;AAC7B,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by Evgeny Barabanov on 05/10/2018.
|
|
3
|
+
*/
|
|
4
|
+
import { BuilderContext } from '@angular-devkit/architect';
|
|
5
|
+
import { executeKarmaBuilder, KarmaBuilderOptions } from '@angular-devkit/build-angular';
|
|
6
|
+
import { json } from '@angular-devkit/core';
|
|
7
|
+
import { CustomWebpackSchema } from '../custom-webpack-schema';
|
|
8
|
+
export type CustomWebpackKarmaBuildSchema = KarmaBuilderOptions & CustomWebpackSchema;
|
|
9
|
+
export declare const buildCustomWebpackKarma: (options: CustomWebpackKarmaBuildSchema, context: BuilderContext) => ReturnType<typeof executeKarmaBuilder>;
|
|
10
|
+
declare const _default: import("@angular-devkit/architect").Builder<json.JsonObject & KarmaBuilderOptions & CustomWebpackSchema>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Created by Evgeny Barabanov on 05/10/2018.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.buildCustomWebpackKarma = void 0;
|
|
7
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
8
|
+
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
9
|
+
const transform_factories_1 = require("../transform-factories");
|
|
10
|
+
const buildCustomWebpackKarma = (options, context) => (0, build_angular_1.executeKarmaBuilder)(options, context, {
|
|
11
|
+
webpackConfiguration: (0, transform_factories_1.customWebpackConfigTransformFactory)(options, context),
|
|
12
|
+
});
|
|
13
|
+
exports.buildCustomWebpackKarma = buildCustomWebpackKarma;
|
|
14
|
+
exports.default = (0, architect_1.createBuilder)(exports.buildCustomWebpackKarma);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/karma/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yDAA0E;AAC1E,iEAAyF;AAEzF,gEAA6E;AAKtE,MAAM,uBAAuB,GAAG,CACrC,OAAsC,EACtC,OAAuB,EACiB,EAAE,CAC1C,IAAA,mCAAmB,EAAC,OAAO,EAAE,OAAO,EAAE;IACpC,oBAAoB,EAAE,IAAA,yDAAmC,EAAC,OAAO,EAAE,OAAO,CAAC;CAC5E,CAAC,CAAC;AANQ,QAAA,uBAAuB,2BAM/B;AAEL,kBAAe,IAAA,yBAAa,EAC1B,+BAAuB,CACxB,CAAC"}
|