@angular-devkit/build-angular 17.0.2 → 17.0.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/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "17.0.2",
3
+ "version": "17.0.3",
4
4
  "description": "Angular Webpack Build Facade",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
7
7
  "builders": "builders.json",
8
8
  "dependencies": {
9
9
  "@ampproject/remapping": "2.2.1",
10
- "@angular-devkit/architect": "0.1700.2",
11
- "@angular-devkit/build-webpack": "0.1700.2",
12
- "@angular-devkit/core": "17.0.2",
10
+ "@angular-devkit/architect": "0.1700.3",
11
+ "@angular-devkit/build-webpack": "0.1700.3",
12
+ "@angular-devkit/core": "17.0.3",
13
13
  "@babel/core": "7.23.2",
14
14
  "@babel/generator": "7.23.0",
15
15
  "@babel/helper-annotate-as-pure": "7.22.5",
@@ -20,7 +20,7 @@
20
20
  "@babel/preset-env": "7.23.2",
21
21
  "@babel/runtime": "7.23.2",
22
22
  "@discoveryjs/json-ext": "0.5.7",
23
- "@ngtools/webpack": "17.0.2",
23
+ "@ngtools/webpack": "17.0.3",
24
24
  "@vitejs/plugin-basic-ssl": "1.0.1",
25
25
  "ansi-colors": "4.1.3",
26
26
  "autoprefixer": "10.4.16",
@@ -71,7 +71,9 @@ async function executePostBundleSteps(options, outputFiles, assetFiles, initialF
71
71
  // If localization is enabled, service worker is handled in the inlining process.
72
72
  if (serviceWorker) {
73
73
  try {
74
- const serviceWorkerResult = await (0, service_worker_1.augmentAppWithServiceWorkerEsbuild)(workspaceRoot, serviceWorker, options.baseHref || '/', outputFiles, assetFiles);
74
+ const serviceWorkerResult = await (0, service_worker_1.augmentAppWithServiceWorkerEsbuild)(workspaceRoot, serviceWorker, options.baseHref || '/',
75
+ // Ensure additional files recently added are used
76
+ [...outputFiles, ...additionalOutputFiles], assetFiles);
75
77
  additionalOutputFiles.push((0, utils_1.createOutputFileFromText)('ngsw.json', serviceWorkerResult.manifest, bundler_context_1.BuildOutputFileType.Browser));
76
78
  additionalAssets.push(...serviceWorkerResult.assetFiles);
77
79
  }
@@ -50,6 +50,10 @@ let postcss;
50
50
  * Based on https://tailwindcss.com/docs/functions-and-directives
51
51
  */
52
52
  const TAILWIND_KEYWORDS = ['@tailwind', '@layer', '@apply', '@config', 'theme(', 'screen('];
53
+ /**
54
+ * Cached postcss instances that can be re-used between various StylesheetPluginFactory instances.
55
+ */
56
+ const postcssProcessor = new Map();
53
57
  class StylesheetPluginFactory {
54
58
  options;
55
59
  cache;
@@ -73,9 +77,15 @@ class StylesheetPluginFactory {
73
77
  return this.postcssProcessor;
74
78
  }
75
79
  if (options.tailwindConfiguration) {
76
- postcss ??= (await Promise.resolve().then(() => __importStar(require('postcss')))).default;
77
- const tailwind = await Promise.resolve(`${options.tailwindConfiguration.package}`).then(s => __importStar(require(s)));
78
- this.postcssProcessor = postcss().use(tailwind.default({ config: options.tailwindConfiguration.file }));
80
+ const { package: tailwindPackage, file: config } = options.tailwindConfiguration;
81
+ const postCssInstanceKey = tailwindPackage + ':' + config;
82
+ this.postcssProcessor = postcssProcessor.get(postCssInstanceKey)?.deref();
83
+ if (!this.postcssProcessor) {
84
+ postcss ??= (await Promise.resolve().then(() => __importStar(require('postcss')))).default;
85
+ const tailwind = await Promise.resolve(`${tailwindPackage}`).then(s => __importStar(require(s)));
86
+ this.postcssProcessor = postcss().use(tailwind.default({ config }));
87
+ postcssProcessor.set(postCssInstanceKey, new WeakRef(this.postcssProcessor));
88
+ }
79
89
  }
80
90
  return this.postcssProcessor;
81
91
  };
@@ -81,5 +81,8 @@ exports.useLegacySass = (() => {
81
81
  })();
82
82
  const debugPerfVariable = process.env['NG_BUILD_DEBUG_PERF'];
83
83
  exports.debugPerformance = isPresent(debugPerfVariable) && isEnabled(debugPerfVariable);
84
+ // Default to true on Windows to workaround Visual Studio atomic file saving watch issues
84
85
  const watchRootVariable = process.env['NG_BUILD_WATCH_ROOT'];
85
- exports.shouldWatchRoot = isPresent(watchRootVariable) && isEnabled(watchRootVariable);
86
+ exports.shouldWatchRoot = process.platform === 'win32'
87
+ ? !isPresent(watchRootVariable) || !isDisabled(watchRootVariable)
88
+ : isPresent(watchRootVariable) && isEnabled(watchRootVariable);