@angular-devkit/build-angular 14.0.0-next.8 → 14.0.0-rc.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.
@@ -6,5 +6,11 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { Configuration } from 'webpack';
9
+ import { StyleElement } from '../../builders/browser/schema';
9
10
  import { WebpackConfigOptions } from '../../utils/build-options';
11
+ export declare function resolveGlobalStyles(styleEntrypoints: StyleElement[], root: string, preserveSymlinks: boolean): {
12
+ entryPoints: Record<string, string[]>;
13
+ noInjectNames: string[];
14
+ paths: string[];
15
+ };
10
16
  export declare function getStylesConfig(wco: WebpackConfigOptions): Configuration;
@@ -33,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.getStylesConfig = void 0;
36
+ exports.getStylesConfig = exports.resolveGlobalStyles = void 0;
37
37
  const fs = __importStar(require("fs"));
38
38
  const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
39
39
  const path = __importStar(require("path"));
@@ -75,6 +75,7 @@ function resolveGlobalStyles(styleEntrypoints, root, preserveSymlinks) {
75
75
  }
76
76
  return { entryPoints, noInjectNames, paths };
77
77
  }
78
+ exports.resolveGlobalStyles = resolveGlobalStyles;
78
79
  // eslint-disable-next-line max-lines-per-function
79
80
  function getStylesConfig(wco) {
80
81
  var _a, _b, _c;
@@ -34,7 +34,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
34
34
  };
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const path = __importStar(require("path"));
37
- const glob = __importStar(require("glob"));
38
37
  const webpack_1 = __importDefault(require("webpack"));
39
38
  const webpack_dev_middleware_1 = __importDefault(require("webpack-dev-middleware"));
40
39
  const stats_1 = require("../../utils/stats");
@@ -46,27 +45,6 @@ let isBlocked = false;
46
45
  let webpackMiddleware;
47
46
  let successCb;
48
47
  let failureCb;
49
- // Add files to the Karma files array.
50
- function addKarmaFiles(files, newFiles, prepend = false) {
51
- const defaults = {
52
- included: true,
53
- served: true,
54
- watched: true,
55
- };
56
- const processedFiles = newFiles
57
- // Remove globs that do not match any files, otherwise Karma will show a warning for these.
58
- .filter((file) => glob.sync(file.pattern, { nodir: true }).length != 0)
59
- // Fill in pattern properties with defaults.
60
- .map((file) => ({ ...defaults, ...file }));
61
- // It's important to not replace the array, because
62
- // karma already has a reference to the existing array.
63
- if (prepend) {
64
- files.unshift(...processedFiles);
65
- }
66
- else {
67
- files.push(...processedFiles);
68
- }
69
- }
70
48
  const init = (config, emitter) => {
71
49
  if (!config.buildWebpack) {
72
50
  throw new Error(`The '@angular-devkit/build-angular/plugins/karma' karma plugin is meant to` +
@@ -84,10 +62,12 @@ const init = (config, emitter) => {
84
62
  // frameworks cannot be added dynamically.
85
63
  const smsPath = path.dirname(require.resolve('source-map-support'));
86
64
  const ksmsPath = path.dirname(require.resolve('karma-source-map-support'));
87
- addKarmaFiles(config.files, [
88
- { pattern: path.join(smsPath, 'browser-source-map-support.js'), watched: false },
89
- { pattern: path.join(ksmsPath, 'client.js'), watched: false },
90
- ], true);
65
+ config.files.unshift({
66
+ pattern: path.join(smsPath, 'browser-source-map-support.js'),
67
+ included: true,
68
+ served: true,
69
+ watched: false,
70
+ }, { pattern: path.join(ksmsPath, 'client.js'), included: true, served: true, watched: false });
91
71
  }
92
72
  config.reporters.unshift('@angular-devkit/build-angular--event-reporter');
93
73
  // When using code-coverage, auto-add karma-coverage.
@@ -162,7 +142,7 @@ const init = (config, emitter) => {
162
142
  webpackMiddleware = (0, webpack_dev_middleware_1.default)(compiler, webpackMiddlewareConfig);
163
143
  emitter.on('exit', (done) => {
164
144
  webpackMiddleware.close();
165
- done();
145
+ compiler.close(() => done());
166
146
  });
167
147
  function unblock() {
168
148
  isBlocked = false;