@angular/build 18.0.0-next.3
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/LICENSE +21 -0
- package/README.md +5 -0
- package/builders.json +14 -0
- package/package.json +87 -0
- package/src/builders/application/build-action.d.ts +33 -0
- package/src/builders/application/build-action.js +183 -0
- package/src/builders/application/execute-build.d.ts +11 -0
- package/src/builders/application/execute-build.js +125 -0
- package/src/builders/application/execute-post-bundle.d.ts +25 -0
- package/src/builders/application/execute-post-bundle.js +93 -0
- package/src/builders/application/i18n.d.ts +29 -0
- package/src/builders/application/i18n.js +128 -0
- package/src/builders/application/index.d.ts +57 -0
- package/src/builders/application/index.js +121 -0
- package/src/builders/application/options.d.ts +149 -0
- package/src/builders/application/options.js +369 -0
- package/src/builders/application/schema.d.ts +512 -0
- package/src/builders/application/schema.js +58 -0
- package/src/builders/application/schema.json +635 -0
- package/src/builders/application/setup-bundling.d.ts +19 -0
- package/src/builders/application/setup-bundling.js +71 -0
- package/src/builders/dev-server/builder.d.ts +32 -0
- package/src/builders/dev-server/builder.js +70 -0
- package/src/builders/dev-server/index.d.ts +14 -0
- package/src/builders/dev-server/index.js +15 -0
- package/src/builders/dev-server/internal.d.ts +19 -0
- package/src/builders/dev-server/internal.js +29 -0
- package/src/builders/dev-server/options.d.ts +47 -0
- package/src/builders/dev-server/options.js +65 -0
- package/src/builders/dev-server/output.d.ts +16 -0
- package/src/builders/dev-server/output.js +9 -0
- package/src/builders/dev-server/schema.d.ts +118 -0
- package/src/builders/dev-server/schema.js +4 -0
- package/src/builders/dev-server/schema.json +131 -0
- package/src/builders/dev-server/vite-server.d.ts +31 -0
- package/src/builders/dev-server/vite-server.js +504 -0
- package/src/index.d.ts +11 -0
- package/src/index.js +16 -0
- package/src/private.d.ts +35 -0
- package/src/private.js +70 -0
- package/src/tools/babel/plugins/adjust-static-class-members.d.ts +26 -0
- package/src/tools/babel/plugins/adjust-static-class-members.js +351 -0
- package/src/tools/babel/plugins/adjust-typescript-enums.d.ts +22 -0
- package/src/tools/babel/plugins/adjust-typescript-enums.js +113 -0
- package/src/tools/babel/plugins/elide-angular-metadata.d.ts +22 -0
- package/src/tools/babel/plugins/elide-angular-metadata.js +110 -0
- package/src/tools/babel/plugins/index.d.ts +11 -0
- package/src/tools/babel/plugins/index.js +21 -0
- package/src/tools/babel/plugins/pure-toplevel-functions.d.ts +15 -0
- package/src/tools/babel/plugins/pure-toplevel-functions.js +90 -0
- package/src/tools/babel/typings.d.ts +21 -0
- package/src/tools/esbuild/angular/angular-host.d.ts +26 -0
- package/src/tools/esbuild/angular/angular-host.js +134 -0
- package/src/tools/esbuild/angular/compilation/angular-compilation.d.ts +42 -0
- package/src/tools/esbuild/angular/compilation/angular-compilation.js +94 -0
- package/src/tools/esbuild/angular/compilation/aot-compilation.d.ts +21 -0
- package/src/tools/esbuild/angular/compilation/aot-compilation.js +224 -0
- package/src/tools/esbuild/angular/compilation/factory.d.ts +16 -0
- package/src/tools/esbuild/angular/compilation/factory.js +56 -0
- package/src/tools/esbuild/angular/compilation/index.d.ts +10 -0
- package/src/tools/esbuild/angular/compilation/index.js +17 -0
- package/src/tools/esbuild/angular/compilation/jit-bootstrap-transformer.d.ts +10 -0
- package/src/tools/esbuild/angular/compilation/jit-bootstrap-transformer.js +182 -0
- package/src/tools/esbuild/angular/compilation/jit-compilation.d.ts +21 -0
- package/src/tools/esbuild/angular/compilation/jit-compilation.js +106 -0
- package/src/tools/esbuild/angular/compilation/noop-compilation.d.ts +20 -0
- package/src/tools/esbuild/angular/compilation/noop-compilation.js +26 -0
- package/src/tools/esbuild/angular/compilation/parallel-compilation.d.ts +42 -0
- package/src/tools/esbuild/angular/compilation/parallel-compilation.js +123 -0
- package/src/tools/esbuild/angular/compilation/parallel-worker.d.ts +33 -0
- package/src/tools/esbuild/angular/compilation/parallel-worker.js +90 -0
- package/src/tools/esbuild/angular/compilation-state.d.ts +15 -0
- package/src/tools/esbuild/angular/compilation-state.js +44 -0
- package/src/tools/esbuild/angular/compiler-plugin.d.ts +27 -0
- package/src/tools/esbuild/angular/compiler-plugin.js +441 -0
- package/src/tools/esbuild/angular/component-stylesheets.d.ts +44 -0
- package/src/tools/esbuild/angular/component-stylesheets.js +150 -0
- package/src/tools/esbuild/angular/diagnostics.d.ts +15 -0
- package/src/tools/esbuild/angular/diagnostics.js +69 -0
- package/src/tools/esbuild/angular/file-reference-tracker.d.ts +17 -0
- package/src/tools/esbuild/angular/file-reference-tracker.js +57 -0
- package/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts +23 -0
- package/src/tools/esbuild/angular/jit-plugin-callbacks.js +117 -0
- package/src/tools/esbuild/angular/jit-resource-transformer.d.ts +17 -0
- package/src/tools/esbuild/angular/jit-resource-transformer.js +186 -0
- package/src/tools/esbuild/angular/source-file-cache.d.ts +18 -0
- package/src/tools/esbuild/angular/source-file-cache.js +65 -0
- package/src/tools/esbuild/angular/uri.d.ts +54 -0
- package/src/tools/esbuild/angular/uri.js +74 -0
- package/src/tools/esbuild/angular/web-worker-transformer.d.ts +17 -0
- package/src/tools/esbuild/angular/web-worker-transformer.js +94 -0
- package/src/tools/esbuild/application-code-bundle.d.ts +20 -0
- package/src/tools/esbuild/application-code-bundle.js +368 -0
- package/src/tools/esbuild/budget-stats.d.ts +19 -0
- package/src/tools/esbuild/budget-stats.js +59 -0
- package/src/tools/esbuild/bundler-context.d.ts +75 -0
- package/src/tools/esbuild/bundler-context.js +366 -0
- package/src/tools/esbuild/bundler-execution-result.d.ts +71 -0
- package/src/tools/esbuild/bundler-execution-result.js +131 -0
- package/src/tools/esbuild/cache.d.ts +88 -0
- package/src/tools/esbuild/cache.js +92 -0
- package/src/tools/esbuild/commonjs-checker.d.ts +28 -0
- package/src/tools/esbuild/commonjs-checker.js +151 -0
- package/src/tools/esbuild/compiler-plugin-options.d.ts +16 -0
- package/src/tools/esbuild/compiler-plugin-options.js +49 -0
- package/src/tools/esbuild/external-packages-plugin.d.ts +18 -0
- package/src/tools/esbuild/external-packages-plugin.js +70 -0
- package/src/tools/esbuild/global-scripts.d.ts +16 -0
- package/src/tools/esbuild/global-scripts.js +142 -0
- package/src/tools/esbuild/global-styles.d.ts +10 -0
- package/src/tools/esbuild/global-styles.js +74 -0
- package/src/tools/esbuild/i18n-inliner-worker.d.ts +42 -0
- package/src/tools/esbuild/i18n-inliner-worker.js +136 -0
- package/src/tools/esbuild/i18n-inliner.d.ts +44 -0
- package/src/tools/esbuild/i18n-inliner.js +150 -0
- package/src/tools/esbuild/i18n-locale-plugin.d.ts +22 -0
- package/src/tools/esbuild/i18n-locale-plugin.js +120 -0
- package/src/tools/esbuild/index-html-generator.d.ts +15 -0
- package/src/tools/esbuild/index-html-generator.js +81 -0
- package/src/tools/esbuild/javascript-transformer-worker.d.ts +19 -0
- package/src/tools/esbuild/javascript-transformer-worker.js +154 -0
- package/src/tools/esbuild/javascript-transformer.d.ts +54 -0
- package/src/tools/esbuild/javascript-transformer.js +147 -0
- package/src/tools/esbuild/license-extractor.d.ts +25 -0
- package/src/tools/esbuild/license-extractor.js +158 -0
- package/src/tools/esbuild/load-result-cache.d.ts +21 -0
- package/src/tools/esbuild/load-result-cache.js +75 -0
- package/src/tools/esbuild/profiling.d.ts +11 -0
- package/src/tools/esbuild/profiling.js +78 -0
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts +18 -0
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.js +44 -0
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts +17 -0
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.js +73 -0
- package/src/tools/esbuild/stylesheets/bundle-options.d.ts +35 -0
- package/src/tools/esbuild/stylesheets/bundle-options.js +64 -0
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts +25 -0
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js +57 -0
- package/src/tools/esbuild/stylesheets/css-language.d.ts +9 -0
- package/src/tools/esbuild/stylesheets/css-language.js +15 -0
- package/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts +18 -0
- package/src/tools/esbuild/stylesheets/css-resource-plugin.js +114 -0
- package/src/tools/esbuild/stylesheets/less-language.d.ts +9 -0
- package/src/tools/esbuild/stylesheets/less-language.js +155 -0
- package/src/tools/esbuild/stylesheets/sass-language.d.ts +10 -0
- package/src/tools/esbuild/stylesheets/sass-language.js +185 -0
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +58 -0
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +282 -0
- package/src/tools/esbuild/utils.d.ts +49 -0
- package/src/tools/esbuild/utils.js +392 -0
- package/src/tools/esbuild/virtual-module-plugin.d.ts +33 -0
- package/src/tools/esbuild/virtual-module-plugin.js +43 -0
- package/src/tools/esbuild/watcher.d.ts +25 -0
- package/src/tools/esbuild/watcher.js +118 -0
- package/src/tools/sass/lexer.d.ts +18 -0
- package/src/tools/sass/lexer.js +161 -0
- package/src/tools/sass/rebasing-importer.d.ts +101 -0
- package/src/tools/sass/rebasing-importer.js +334 -0
- package/src/tools/sass/sass-service.d.ts +72 -0
- package/src/tools/sass/sass-service.js +213 -0
- package/src/tools/sass/worker.d.ts +8 -0
- package/src/tools/sass/worker.js +192 -0
- package/src/tools/vite/angular-memory-plugin.d.ts +24 -0
- package/src/tools/vite/angular-memory-plugin.js +268 -0
- package/src/tools/vite/i18n-locale-plugin.d.ts +18 -0
- package/src/tools/vite/i18n-locale-plugin.js +55 -0
- package/src/utils/bundle-calculator.d.ts +44 -0
- package/src/utils/bundle-calculator.js +303 -0
- package/src/utils/check-port.d.ts +8 -0
- package/src/utils/check-port.js +58 -0
- package/src/utils/color.d.ts +10 -0
- package/src/utils/color.js +63 -0
- package/src/utils/delete-output-dir.d.ts +11 -0
- package/src/utils/delete-output-dir.js +46 -0
- package/src/utils/environment-options.d.ts +16 -0
- package/src/utils/environment-options.js +79 -0
- package/src/utils/error.d.ts +10 -0
- package/src/utils/error.js +21 -0
- package/src/utils/format-bytes.d.ts +8 -0
- package/src/utils/format-bytes.js +22 -0
- package/src/utils/i18n-options.d.ts +33 -0
- package/src/utils/i18n-options.js +161 -0
- package/src/utils/index-file/add-event-dispatch-contract.d.ts +8 -0
- package/src/utils/index-file/add-event-dispatch-contract.js +28 -0
- package/src/utils/index-file/augment-index-html.d.ts +40 -0
- package/src/utils/index-file/augment-index-html.js +239 -0
- package/src/utils/index-file/html-rewriting-stream.d.ts +11 -0
- package/src/utils/index-file/html-rewriting-stream.js +28 -0
- package/src/utils/index-file/index-html-generator.d.ts +57 -0
- package/src/utils/index-file/index-html-generator.js +135 -0
- package/src/utils/index-file/inline-critical-css.d.ts +24 -0
- package/src/utils/index-file/inline-critical-css.js +179 -0
- package/src/utils/index-file/inline-fonts.d.ts +23 -0
- package/src/utils/index-file/inline-fonts.js +267 -0
- package/src/utils/index-file/nonce.d.ts +12 -0
- package/src/utils/index-file/nonce.js +55 -0
- package/src/utils/index-file/style-nonce.d.ts +12 -0
- package/src/utils/index-file/style-nonce.js +55 -0
- package/src/utils/index.d.ts +11 -0
- package/src/utils/index.js +27 -0
- package/src/utils/load-esm.d.ts +20 -0
- package/src/utils/load-esm.js +31 -0
- package/src/utils/load-proxy-config.d.ts +8 -0
- package/src/utils/load-proxy-config.js +189 -0
- package/src/utils/load-translations.d.ts +16 -0
- package/src/utils/load-translations.js +84 -0
- package/src/utils/normalize-asset-patterns.d.ts +14 -0
- package/src/utils/normalize-asset-patterns.js +96 -0
- package/src/utils/normalize-cache.d.ts +16 -0
- package/src/utils/normalize-cache.js +44 -0
- package/src/utils/normalize-optimization.d.ts +13 -0
- package/src/utils/normalize-optimization.js +42 -0
- package/src/utils/normalize-source-maps.d.ts +9 -0
- package/src/utils/normalize-source-maps.js +23 -0
- package/src/utils/postcss-configuration.d.ts +17 -0
- package/src/utils/postcss-configuration.js +86 -0
- package/src/utils/purge-cache.d.ts +10 -0
- package/src/utils/purge-cache.js +40 -0
- package/src/utils/resolve-assets.d.ts +18 -0
- package/src/utils/resolve-assets.js +35 -0
- package/src/utils/routes-extractor/extractor.d.ts +15 -0
- package/src/utils/routes-extractor/extractor.js +97 -0
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.d.ts +18 -0
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js +129 -0
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.d.ts +8 -0
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js +13 -0
- package/src/utils/server-rendering/fetch-patch.d.ts +8 -0
- package/src/utils/server-rendering/fetch-patch.js +66 -0
- package/src/utils/server-rendering/load-esm-from-memory.d.ts +10 -0
- package/src/utils/server-rendering/load-esm-from-memory.js +26 -0
- package/src/utils/server-rendering/main-bundle-exports.d.ts +27 -0
- package/src/utils/server-rendering/main-bundle-exports.js +9 -0
- package/src/utils/server-rendering/prerender.d.ts +23 -0
- package/src/utils/server-rendering/prerender.js +192 -0
- package/src/utils/server-rendering/render-page.d.ts +26 -0
- package/src/utils/server-rendering/render-page.js +110 -0
- package/src/utils/server-rendering/render-worker.d.ts +22 -0
- package/src/utils/server-rendering/render-worker.js +30 -0
- package/src/utils/server-rendering/routes-extractor-worker.d.ts +21 -0
- package/src/utils/server-rendering/routes-extractor-worker.js +53 -0
- package/src/utils/service-worker.d.ts +25 -0
- package/src/utils/service-worker.js +211 -0
- package/src/utils/spinner.d.ts +20 -0
- package/src/utils/spinner.js +55 -0
- package/src/utils/stats-table.d.ts +20 -0
- package/src/utils/stats-table.js +205 -0
- package/src/utils/supported-browsers.d.ts +10 -0
- package/src/utils/supported-browsers.js +42 -0
- package/src/utils/tty.d.ts +8 -0
- package/src/utils/tty.js +23 -0
- package/src/utils/url.d.ts +8 -0
- package/src/utils/url.js +18 -0
- package/src/utils/version.d.ts +8 -0
- package/src/utils/version.js +59 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.setupBundlerContexts = void 0;
|
|
11
|
+
const application_code_bundle_1 = require("../../tools/esbuild/application-code-bundle");
|
|
12
|
+
const bundler_context_1 = require("../../tools/esbuild/bundler-context");
|
|
13
|
+
const global_scripts_1 = require("../../tools/esbuild/global-scripts");
|
|
14
|
+
const global_styles_1 = require("../../tools/esbuild/global-styles");
|
|
15
|
+
const utils_1 = require("../../tools/esbuild/utils");
|
|
16
|
+
/**
|
|
17
|
+
* Generates one or more BundlerContext instances based on the builder provided
|
|
18
|
+
* configuration.
|
|
19
|
+
* @param options The normalized application builder options to use.
|
|
20
|
+
* @param browsers An string array of browserslist browsers to support.
|
|
21
|
+
* @param codeBundleCache An instance of the TypeScript source file cache.
|
|
22
|
+
* @returns An array of BundlerContext objects.
|
|
23
|
+
*/
|
|
24
|
+
function setupBundlerContexts(options, browsers, codeBundleCache) {
|
|
25
|
+
const { appShellOptions, prerenderOptions, serverEntryPoint, ssrOptions, workspaceRoot } = options;
|
|
26
|
+
const target = (0, utils_1.transformSupportedBrowsersToTargets)(browsers);
|
|
27
|
+
const bundlerContexts = [];
|
|
28
|
+
// Browser application code
|
|
29
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, !!options.watch, (0, application_code_bundle_1.createBrowserCodeBundleOptions)(options, target, codeBundleCache)));
|
|
30
|
+
// Browser polyfills code
|
|
31
|
+
const browserPolyfillBundleOptions = (0, application_code_bundle_1.createBrowserPolyfillBundleOptions)(options, target, codeBundleCache);
|
|
32
|
+
if (browserPolyfillBundleOptions) {
|
|
33
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, !!options.watch, browserPolyfillBundleOptions));
|
|
34
|
+
}
|
|
35
|
+
// Global Stylesheets
|
|
36
|
+
if (options.globalStyles.length > 0) {
|
|
37
|
+
for (const initial of [true, false]) {
|
|
38
|
+
const bundleOptions = (0, global_styles_1.createGlobalStylesBundleOptions)(options, target, initial);
|
|
39
|
+
if (bundleOptions) {
|
|
40
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, !!options.watch, bundleOptions, () => initial));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Global Scripts
|
|
45
|
+
if (options.globalScripts.length > 0) {
|
|
46
|
+
for (const initial of [true, false]) {
|
|
47
|
+
const bundleOptions = (0, global_scripts_1.createGlobalScriptsBundleOptions)(options, target, initial);
|
|
48
|
+
if (bundleOptions) {
|
|
49
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, !!options.watch, bundleOptions, () => initial));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Skip server build when none of the features are enabled.
|
|
54
|
+
if (serverEntryPoint && (prerenderOptions || appShellOptions || ssrOptions)) {
|
|
55
|
+
const nodeTargets = [...target, ...(0, utils_1.getSupportedNodeTargets)()];
|
|
56
|
+
// Server application code
|
|
57
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, !!options.watch, (0, application_code_bundle_1.createServerCodeBundleOptions)({
|
|
58
|
+
...options,
|
|
59
|
+
// Disable external deps for server bundles.
|
|
60
|
+
// This is because it breaks Vite 'optimizeDeps' for SSR.
|
|
61
|
+
externalPackages: false,
|
|
62
|
+
}, nodeTargets, codeBundleCache)));
|
|
63
|
+
// Server polyfills code
|
|
64
|
+
const serverPolyfillBundleOptions = (0, application_code_bundle_1.createServerPolyfillBundleOptions)(options, nodeTargets, codeBundleCache);
|
|
65
|
+
if (serverPolyfillBundleOptions) {
|
|
66
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, !!options.watch, serverPolyfillBundleOptions));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return bundlerContexts;
|
|
70
|
+
}
|
|
71
|
+
exports.setupBundlerContexts = setupBundlerContexts;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="node" />
|
|
9
|
+
import type { BuilderContext } from '@angular-devkit/architect';
|
|
10
|
+
import type { Plugin } from 'esbuild';
|
|
11
|
+
import type http from 'node:http';
|
|
12
|
+
import { type IndexHtmlTransform } from './internal';
|
|
13
|
+
import type { DevServerBuilderOutput } from './output';
|
|
14
|
+
import type { Schema as DevServerBuilderOptions } from './schema';
|
|
15
|
+
/**
|
|
16
|
+
* A Builder that executes a development server based on the provided browser target option.
|
|
17
|
+
*
|
|
18
|
+
* Usage of the `transforms` and/or `extensions` parameters is NOT supported and may cause
|
|
19
|
+
* unexpected build output or build failures.
|
|
20
|
+
*
|
|
21
|
+
* @param options Dev Server options.
|
|
22
|
+
* @param context The build context.
|
|
23
|
+
* @param extensions An optional object containing an array of build plugins (esbuild-based)
|
|
24
|
+
* and/or HTTP request middleware.
|
|
25
|
+
*
|
|
26
|
+
* @experimental Direct usage of this function is considered experimental.
|
|
27
|
+
*/
|
|
28
|
+
export declare function execute(options: DevServerBuilderOptions, context: BuilderContext, extensions?: {
|
|
29
|
+
buildPlugins?: Plugin[];
|
|
30
|
+
middleware?: ((req: http.IncomingMessage, res: http.ServerResponse, next: (err?: unknown) => void) => void)[];
|
|
31
|
+
indexHtmlTransformer?: IndexHtmlTransform;
|
|
32
|
+
}): AsyncIterable<DevServerBuilderOutput>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.execute = void 0;
|
|
11
|
+
const check_port_1 = require("../../utils/check-port");
|
|
12
|
+
const internal_1 = require("./internal");
|
|
13
|
+
const options_1 = require("./options");
|
|
14
|
+
const vite_server_1 = require("./vite-server");
|
|
15
|
+
/**
|
|
16
|
+
* A Builder that executes a development server based on the provided browser target option.
|
|
17
|
+
*
|
|
18
|
+
* Usage of the `transforms` and/or `extensions` parameters is NOT supported and may cause
|
|
19
|
+
* unexpected build output or build failures.
|
|
20
|
+
*
|
|
21
|
+
* @param options Dev Server options.
|
|
22
|
+
* @param context The build context.
|
|
23
|
+
* @param extensions An optional object containing an array of build plugins (esbuild-based)
|
|
24
|
+
* and/or HTTP request middleware.
|
|
25
|
+
*
|
|
26
|
+
* @experimental Direct usage of this function is considered experimental.
|
|
27
|
+
*/
|
|
28
|
+
async function* execute(options, context, extensions) {
|
|
29
|
+
// Determine project name from builder context target
|
|
30
|
+
const projectName = context.target?.project;
|
|
31
|
+
if (!projectName) {
|
|
32
|
+
context.logger.error(`The "dev-server" builder requires a target to be specified.`);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const { builderName, normalizedOptions } = await initialize(options, projectName, context);
|
|
36
|
+
// Warn if the initial options provided by the user enable prebundling but caching is disabled
|
|
37
|
+
if (options.prebundle && !normalizedOptions.cacheOptions.enabled) {
|
|
38
|
+
context.logger.warn(`Prebundling has been configured but will not be used because caching has been disabled.`);
|
|
39
|
+
}
|
|
40
|
+
yield* (0, vite_server_1.serveWithVite)(normalizedOptions, builderName, (options, context, plugins) => (0, internal_1.buildApplicationInternal)(options, context, { write: false }, { codePlugins: plugins }), context, { indexHtml: extensions?.indexHtmlTransformer }, extensions);
|
|
41
|
+
}
|
|
42
|
+
exports.execute = execute;
|
|
43
|
+
async function initialize(initialOptions, projectName, context) {
|
|
44
|
+
// Purge old build disk cache.
|
|
45
|
+
await (0, internal_1.purgeStaleBuildCache)(context);
|
|
46
|
+
const normalizedOptions = await (0, options_1.normalizeOptions)(context, projectName, initialOptions);
|
|
47
|
+
const builderName = await context.getBuilderNameForTarget(normalizedOptions.buildTarget);
|
|
48
|
+
if (!normalizedOptions.disableHostCheck &&
|
|
49
|
+
!/^127\.\d+\.\d+\.\d+/g.test(normalizedOptions.host) &&
|
|
50
|
+
normalizedOptions.host !== 'localhost') {
|
|
51
|
+
context.logger.warn(`
|
|
52
|
+
Warning: This is a simple server for use in testing or debugging Angular applications
|
|
53
|
+
locally. It hasn't been reviewed for security issues.
|
|
54
|
+
|
|
55
|
+
Binding this server to an open connection can result in compromising your application or
|
|
56
|
+
computer. Using a different host than the one passed to the "--host" flag might result in
|
|
57
|
+
websocket connection issues. You might need to use "--disable-host-check" if that's the
|
|
58
|
+
case.
|
|
59
|
+
`);
|
|
60
|
+
}
|
|
61
|
+
if (normalizedOptions.disableHostCheck) {
|
|
62
|
+
context.logger.warn('Warning: Running a server with --disable-host-check is a security risk. ' +
|
|
63
|
+
'See https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a for more information.');
|
|
64
|
+
}
|
|
65
|
+
normalizedOptions.port = await (0, check_port_1.checkPort)(normalizedOptions.port, normalizedOptions.host);
|
|
66
|
+
return {
|
|
67
|
+
builderName,
|
|
68
|
+
normalizedOptions,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { execute } from './builder';
|
|
9
|
+
import { DevServerBuilderOutput } from './output';
|
|
10
|
+
import { Schema as DevServerBuilderOptions } from './schema';
|
|
11
|
+
export { DevServerBuilderOptions, DevServerBuilderOutput, execute as executeDevServerBuilder };
|
|
12
|
+
declare const _default: import("../../../../../angular_devkit/architect/src/internal").Builder<DevServerBuilderOptions & import("../../../../../angular_devkit/core/src").JsonObject>;
|
|
13
|
+
export default _default;
|
|
14
|
+
export { execute as executeDevServer };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.executeDevServer = exports.executeDevServerBuilder = void 0;
|
|
11
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
12
|
+
const builder_1 = require("./builder");
|
|
13
|
+
Object.defineProperty(exports, "executeDevServerBuilder", { enumerable: true, get: function () { return builder_1.execute; } });
|
|
14
|
+
Object.defineProperty(exports, "executeDevServer", { enumerable: true, get: function () { return builder_1.execute; } });
|
|
15
|
+
exports.default = (0, architect_1.createBuilder)(builder_1.execute);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
export { BuildOutputFile, BuildOutputFileType } from '@angular/build';
|
|
9
|
+
export { createRxjsEsmResolutionPlugin } from '../../tools/esbuild/rxjs-esm-resolution-plugin';
|
|
10
|
+
export { JavaScriptTransformer } from '../../tools/esbuild/javascript-transformer';
|
|
11
|
+
export { getFeatureSupport, isZonelessApp } from '../../tools/esbuild/utils';
|
|
12
|
+
export { renderPage } from '../../utils/server-rendering/render-page';
|
|
13
|
+
export { type IndexHtmlTransform } from '../../utils/index-file/index-html-generator';
|
|
14
|
+
export { purgeStaleBuildCache } from '../../utils/purge-cache';
|
|
15
|
+
export { getSupportedBrowsers } from '../../utils/supported-browsers';
|
|
16
|
+
export { transformSupportedBrowsersToTargets } from '../../tools/esbuild/utils';
|
|
17
|
+
export { buildApplicationInternal } from '../../builders/application';
|
|
18
|
+
export { ApplicationBuilderInternalOptions } from '../../builders/application/options';
|
|
19
|
+
export { ExternalResultMetadata } from '../../tools/esbuild/bundler-execution-result';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.buildApplicationInternal = exports.transformSupportedBrowsersToTargets = exports.getSupportedBrowsers = exports.purgeStaleBuildCache = exports.renderPage = exports.isZonelessApp = exports.getFeatureSupport = exports.JavaScriptTransformer = exports.createRxjsEsmResolutionPlugin = exports.BuildOutputFileType = void 0;
|
|
11
|
+
var build_1 = require("@angular/build");
|
|
12
|
+
Object.defineProperty(exports, "BuildOutputFileType", { enumerable: true, get: function () { return build_1.BuildOutputFileType; } });
|
|
13
|
+
var rxjs_esm_resolution_plugin_1 = require("../../tools/esbuild/rxjs-esm-resolution-plugin");
|
|
14
|
+
Object.defineProperty(exports, "createRxjsEsmResolutionPlugin", { enumerable: true, get: function () { return rxjs_esm_resolution_plugin_1.createRxjsEsmResolutionPlugin; } });
|
|
15
|
+
var javascript_transformer_1 = require("../../tools/esbuild/javascript-transformer");
|
|
16
|
+
Object.defineProperty(exports, "JavaScriptTransformer", { enumerable: true, get: function () { return javascript_transformer_1.JavaScriptTransformer; } });
|
|
17
|
+
var utils_1 = require("../../tools/esbuild/utils");
|
|
18
|
+
Object.defineProperty(exports, "getFeatureSupport", { enumerable: true, get: function () { return utils_1.getFeatureSupport; } });
|
|
19
|
+
Object.defineProperty(exports, "isZonelessApp", { enumerable: true, get: function () { return utils_1.isZonelessApp; } });
|
|
20
|
+
var render_page_1 = require("../../utils/server-rendering/render-page");
|
|
21
|
+
Object.defineProperty(exports, "renderPage", { enumerable: true, get: function () { return render_page_1.renderPage; } });
|
|
22
|
+
var purge_cache_1 = require("../../utils/purge-cache");
|
|
23
|
+
Object.defineProperty(exports, "purgeStaleBuildCache", { enumerable: true, get: function () { return purge_cache_1.purgeStaleBuildCache; } });
|
|
24
|
+
var supported_browsers_1 = require("../../utils/supported-browsers");
|
|
25
|
+
Object.defineProperty(exports, "getSupportedBrowsers", { enumerable: true, get: function () { return supported_browsers_1.getSupportedBrowsers; } });
|
|
26
|
+
var utils_2 = require("../../tools/esbuild/utils");
|
|
27
|
+
Object.defineProperty(exports, "transformSupportedBrowsersToTargets", { enumerable: true, get: function () { return utils_2.transformSupportedBrowsersToTargets; } });
|
|
28
|
+
var application_1 = require("../../builders/application");
|
|
29
|
+
Object.defineProperty(exports, "buildApplicationInternal", { enumerable: true, get: function () { return application_1.buildApplicationInternal; } });
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { BuilderContext } from '@angular-devkit/architect';
|
|
9
|
+
import { Schema as DevServerOptions } from './schema';
|
|
10
|
+
export type NormalizedDevServerOptions = Awaited<ReturnType<typeof normalizeOptions>>;
|
|
11
|
+
/**
|
|
12
|
+
* Normalize the user provided options by creating full paths for all path based options
|
|
13
|
+
* and converting multi-form options into a single form that can be directly used
|
|
14
|
+
* by the build process.
|
|
15
|
+
*
|
|
16
|
+
* @param context The context for current builder execution.
|
|
17
|
+
* @param projectName The name of the project for the current execution.
|
|
18
|
+
* @param options An object containing the options to use for the build.
|
|
19
|
+
* @returns An object containing normalized options required to perform the build.
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeOptions(context: BuilderContext, projectName: string, options: DevServerOptions): Promise<{
|
|
22
|
+
buildTarget: import("@angular-devkit/architect").Target;
|
|
23
|
+
host: string;
|
|
24
|
+
port: number;
|
|
25
|
+
poll: number | undefined;
|
|
26
|
+
open: boolean | undefined;
|
|
27
|
+
verbose: boolean | undefined;
|
|
28
|
+
watch: boolean | undefined;
|
|
29
|
+
liveReload: boolean | undefined;
|
|
30
|
+
hmr: boolean | undefined;
|
|
31
|
+
headers: {
|
|
32
|
+
[key: string]: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
workspaceRoot: string;
|
|
35
|
+
projectRoot: string;
|
|
36
|
+
cacheOptions: import("../../utils/normalize-cache").NormalizedCachedOptions;
|
|
37
|
+
allowedHosts: string[] | undefined;
|
|
38
|
+
disableHostCheck: boolean | undefined;
|
|
39
|
+
proxyConfig: string | undefined;
|
|
40
|
+
servePath: string | undefined;
|
|
41
|
+
publicHost: string | undefined;
|
|
42
|
+
ssl: boolean | undefined;
|
|
43
|
+
sslCert: string | undefined;
|
|
44
|
+
sslKey: string | undefined;
|
|
45
|
+
forceEsbuild: boolean | undefined;
|
|
46
|
+
prebundle: import("./schema").PrebundleUnion;
|
|
47
|
+
}>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.normalizeOptions = void 0;
|
|
14
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
15
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
16
|
+
const normalize_cache_1 = require("../../utils/normalize-cache");
|
|
17
|
+
/**
|
|
18
|
+
* Normalize the user provided options by creating full paths for all path based options
|
|
19
|
+
* and converting multi-form options into a single form that can be directly used
|
|
20
|
+
* by the build process.
|
|
21
|
+
*
|
|
22
|
+
* @param context The context for current builder execution.
|
|
23
|
+
* @param projectName The name of the project for the current execution.
|
|
24
|
+
* @param options An object containing the options to use for the build.
|
|
25
|
+
* @returns An object containing normalized options required to perform the build.
|
|
26
|
+
*/
|
|
27
|
+
async function normalizeOptions(context, projectName, options) {
|
|
28
|
+
const workspaceRoot = context.workspaceRoot;
|
|
29
|
+
const projectMetadata = await context.getProjectMetadata(projectName);
|
|
30
|
+
const projectRoot = node_path_1.default.join(workspaceRoot, projectMetadata.root ?? '');
|
|
31
|
+
const cacheOptions = (0, normalize_cache_1.normalizeCacheOptions)(projectMetadata, workspaceRoot);
|
|
32
|
+
// Target specifier defaults to the current project's build target using a development configuration
|
|
33
|
+
const buildTargetSpecifier = options.buildTarget ?? options.browserTarget ?? `::development`;
|
|
34
|
+
const buildTarget = (0, architect_1.targetFromTargetString)(buildTargetSpecifier, projectName, 'build');
|
|
35
|
+
// Initial options to keep
|
|
36
|
+
const { host, port, poll, open, verbose, watch, allowedHosts, disableHostCheck, liveReload, hmr, headers, proxyConfig, servePath, publicHost, ssl, sslCert, sslKey, forceEsbuild, prebundle, } = options;
|
|
37
|
+
// Return all the normalized options
|
|
38
|
+
return {
|
|
39
|
+
buildTarget,
|
|
40
|
+
host: host ?? 'localhost',
|
|
41
|
+
port: port ?? 4200,
|
|
42
|
+
poll,
|
|
43
|
+
open,
|
|
44
|
+
verbose,
|
|
45
|
+
watch,
|
|
46
|
+
liveReload,
|
|
47
|
+
hmr,
|
|
48
|
+
headers,
|
|
49
|
+
workspaceRoot,
|
|
50
|
+
projectRoot,
|
|
51
|
+
cacheOptions,
|
|
52
|
+
allowedHosts,
|
|
53
|
+
disableHostCheck,
|
|
54
|
+
proxyConfig,
|
|
55
|
+
servePath,
|
|
56
|
+
publicHost,
|
|
57
|
+
ssl,
|
|
58
|
+
sslCert,
|
|
59
|
+
sslKey,
|
|
60
|
+
forceEsbuild,
|
|
61
|
+
// Prebundling defaults to true but requires caching to function
|
|
62
|
+
prebundle: cacheOptions.enabled && (prebundle ?? true),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
exports.normalizeOptions = normalizeOptions;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { BuilderOutput } from '@angular-devkit/architect';
|
|
9
|
+
/**
|
|
10
|
+
* @experimental Direct usage of this type is considered experimental.
|
|
11
|
+
*/
|
|
12
|
+
export interface DevServerBuilderOutput extends BuilderOutput {
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
port?: number;
|
|
15
|
+
address?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev Server target options for Build Facade.
|
|
3
|
+
*/
|
|
4
|
+
export interface Schema {
|
|
5
|
+
/**
|
|
6
|
+
* List of hosts that are allowed to access the dev server. This option has no effect when
|
|
7
|
+
* using the 'application' or other esbuild-based builders.
|
|
8
|
+
*/
|
|
9
|
+
allowedHosts?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* A browser builder target to serve in the format of `project:target[:configuration]`. You
|
|
12
|
+
* can also pass in more than one configuration name as a comma-separated list. Example:
|
|
13
|
+
* `project:target:production,staging`.
|
|
14
|
+
* @deprecated Use 'buildTarget' instead.
|
|
15
|
+
*/
|
|
16
|
+
browserTarget?: string;
|
|
17
|
+
/**
|
|
18
|
+
* A build builder target to serve in the format of `project:target[:configuration]`. You
|
|
19
|
+
* can also pass in more than one configuration name as a comma-separated list. Example:
|
|
20
|
+
* `project:target:production,staging`.
|
|
21
|
+
*/
|
|
22
|
+
buildTarget?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Don't verify connected clients are part of allowed hosts. This option has no effect when
|
|
25
|
+
* using the 'application' or other esbuild-based builders.
|
|
26
|
+
*/
|
|
27
|
+
disableHostCheck?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Force the development server to use the 'browser-esbuild' builder when building. This is
|
|
30
|
+
* a developer preview option for the esbuild-based build system.
|
|
31
|
+
*/
|
|
32
|
+
forceEsbuild?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Custom HTTP headers to be added to all responses.
|
|
35
|
+
*/
|
|
36
|
+
headers?: {
|
|
37
|
+
[key: string]: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Enable hot module replacement.
|
|
41
|
+
*/
|
|
42
|
+
hmr?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Host to listen on.
|
|
45
|
+
*/
|
|
46
|
+
host?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether to reload the page on change, using live-reload.
|
|
49
|
+
*/
|
|
50
|
+
liveReload?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Opens the url in default browser.
|
|
53
|
+
*/
|
|
54
|
+
open?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Enable and define the file watching poll time period in milliseconds.
|
|
57
|
+
*/
|
|
58
|
+
poll?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Port to listen on.
|
|
61
|
+
*/
|
|
62
|
+
port?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Enable and control the Vite-based development server's prebundling capabilities. To
|
|
65
|
+
* enable prebundling, the Angular CLI cache must also be enabled. This option has no effect
|
|
66
|
+
* when using the 'browser' or other Webpack-based builders.
|
|
67
|
+
*/
|
|
68
|
+
prebundle?: PrebundleUnion;
|
|
69
|
+
/**
|
|
70
|
+
* Proxy configuration file. For more information, see
|
|
71
|
+
* https://angular.io/guide/build#proxying-to-a-backend-server.
|
|
72
|
+
*/
|
|
73
|
+
proxyConfig?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The URL that the browser client (or live-reload client, if enabled) should use to connect
|
|
76
|
+
* to the development server. Use for a complex dev server setup, such as one with reverse
|
|
77
|
+
* proxies. This option has no effect when using the 'application' or other esbuild-based
|
|
78
|
+
* builders.
|
|
79
|
+
*/
|
|
80
|
+
publicHost?: string;
|
|
81
|
+
/**
|
|
82
|
+
* The pathname where the application will be served.
|
|
83
|
+
*/
|
|
84
|
+
servePath?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Serve using HTTPS.
|
|
87
|
+
*/
|
|
88
|
+
ssl?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* SSL certificate to use for serving HTTPS.
|
|
91
|
+
*/
|
|
92
|
+
sslCert?: string;
|
|
93
|
+
/**
|
|
94
|
+
* SSL key to use for serving HTTPS.
|
|
95
|
+
*/
|
|
96
|
+
sslKey?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Adds more details to output logging.
|
|
99
|
+
*/
|
|
100
|
+
verbose?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Rebuild on change.
|
|
103
|
+
*/
|
|
104
|
+
watch?: boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Enable and control the Vite-based development server's prebundling capabilities. To
|
|
108
|
+
* enable prebundling, the Angular CLI cache must also be enabled. This option has no effect
|
|
109
|
+
* when using the 'browser' or other Webpack-based builders.
|
|
110
|
+
*/
|
|
111
|
+
export type PrebundleUnion = boolean | PrebundleClass;
|
|
112
|
+
export interface PrebundleClass {
|
|
113
|
+
/**
|
|
114
|
+
* List of package imports that should not be prebundled by the development server. The
|
|
115
|
+
* packages will be bundled into the application code itself.
|
|
116
|
+
*/
|
|
117
|
+
exclude: string[];
|
|
118
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"title": "Dev Server Target",
|
|
4
|
+
"description": "Dev Server target options for Build Facade.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"browserTarget": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "A browser 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
|
+
"x-deprecated": "Use 'buildTarget' instead."
|
|
12
|
+
},
|
|
13
|
+
"buildTarget": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"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`.",
|
|
16
|
+
"pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$"
|
|
17
|
+
},
|
|
18
|
+
"port": {
|
|
19
|
+
"type": "number",
|
|
20
|
+
"description": "Port to listen on.",
|
|
21
|
+
"default": 4200
|
|
22
|
+
},
|
|
23
|
+
"host": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Host to listen on.",
|
|
26
|
+
"default": "localhost"
|
|
27
|
+
},
|
|
28
|
+
"proxyConfig": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server."
|
|
31
|
+
},
|
|
32
|
+
"ssl": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"description": "Serve using HTTPS.",
|
|
35
|
+
"default": false
|
|
36
|
+
},
|
|
37
|
+
"sslKey": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "SSL key to use for serving HTTPS."
|
|
40
|
+
},
|
|
41
|
+
"sslCert": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "SSL certificate to use for serving HTTPS."
|
|
44
|
+
},
|
|
45
|
+
"headers": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "Custom HTTP headers to be added to all responses.",
|
|
48
|
+
"propertyNames": {
|
|
49
|
+
"pattern": "^[-_A-Za-z0-9]+$"
|
|
50
|
+
},
|
|
51
|
+
"additionalProperties": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"open": {
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"description": "Opens the url in default browser.",
|
|
58
|
+
"default": false,
|
|
59
|
+
"alias": "o"
|
|
60
|
+
},
|
|
61
|
+
"verbose": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"description": "Adds more details to output logging."
|
|
64
|
+
},
|
|
65
|
+
"liveReload": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"description": "Whether to reload the page on change, using live-reload.",
|
|
68
|
+
"default": true
|
|
69
|
+
},
|
|
70
|
+
"publicHost": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"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."
|
|
73
|
+
},
|
|
74
|
+
"allowedHosts": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"description": "List of hosts that are allowed to access the dev server. This option has no effect when using the 'application' or other esbuild-based builders.",
|
|
77
|
+
"default": [],
|
|
78
|
+
"items": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"servePath": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"description": "The pathname where the application will be served."
|
|
85
|
+
},
|
|
86
|
+
"disableHostCheck": {
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"description": "Don't verify connected clients are part of allowed hosts. This option has no effect when using the 'application' or other esbuild-based builders.",
|
|
89
|
+
"default": false
|
|
90
|
+
},
|
|
91
|
+
"hmr": {
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"description": "Enable hot module replacement.",
|
|
94
|
+
"default": false
|
|
95
|
+
},
|
|
96
|
+
"watch": {
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"description": "Rebuild on change.",
|
|
99
|
+
"default": true
|
|
100
|
+
},
|
|
101
|
+
"poll": {
|
|
102
|
+
"type": "number",
|
|
103
|
+
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
104
|
+
},
|
|
105
|
+
"forceEsbuild": {
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system.",
|
|
108
|
+
"default": false
|
|
109
|
+
},
|
|
110
|
+
"prebundle": {
|
|
111
|
+
"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.",
|
|
112
|
+
"oneOf": [
|
|
113
|
+
{ "type": "boolean" },
|
|
114
|
+
{
|
|
115
|
+
"type": "object",
|
|
116
|
+
"properties": {
|
|
117
|
+
"exclude": {
|
|
118
|
+
"description": "List of package imports that should not be prebundled by the development server. The packages will be bundled into the application code itself.",
|
|
119
|
+
"type": "array",
|
|
120
|
+
"items": { "type": "string" }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"required": ["exclude"]
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"additionalProperties": false,
|
|
130
|
+
"anyOf": [{ "required": ["buildTarget"] }, { "required": ["browserTarget"] }]
|
|
131
|
+
}
|