@angular-devkit/build-angular 15.0.0-rc.2 → 15.0.0-rc.4

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.
@@ -48,7 +48,7 @@ const helpers_1 = require("../utils/helpers");
48
48
  // eslint-disable-next-line max-lines-per-function
49
49
  function getStylesConfig(wco) {
50
50
  var _a, _b, _c;
51
- const { root, buildOptions } = wco;
51
+ const { root, buildOptions, logger } = wco;
52
52
  const extraPlugins = [];
53
53
  extraPlugins.push(new plugins_1.AnyComponentStyleBudgetChecker(buildOptions.budgets));
54
54
  const cssSourceMap = buildOptions.sourceMap.styles;
@@ -93,7 +93,7 @@ function getStylesConfig(wco) {
93
93
  }
94
94
  catch {
95
95
  const relativeTailwindConfigPath = path.relative(wco.root, tailwindConfigPath);
96
- wco.logger.warn(`Tailwind CSS configuration file found (${relativeTailwindConfigPath})` +
96
+ logger.warn(`Tailwind CSS configuration file found (${relativeTailwindConfigPath})` +
97
97
  ` but the 'tailwindcss' package is not installed.` +
98
98
  ` To enable Tailwind CSS, please install the 'tailwindcss' package.`);
99
99
  }
@@ -131,14 +131,21 @@ function getStylesConfig(wco) {
131
131
  optionGenerator.config = false;
132
132
  return optionGenerator;
133
133
  };
134
- // load component css as raw strings
135
- const componentsSourceMap = !!(cssSourceMap &&
136
- // Never use component css sourcemap when style optimizations are on.
137
- // It will just increase bundle size without offering good debug experience.
138
- !buildOptions.optimization.styles.minify &&
139
- // Inline all sourcemap types except hidden ones, which are the same as no sourcemaps
140
- // for component css.
141
- !buildOptions.sourceMap.hidden);
134
+ let componentsSourceMap = !!cssSourceMap;
135
+ if (cssSourceMap) {
136
+ if (buildOptions.optimization.styles.minify) {
137
+ // Never use component css sourcemap when style optimizations are on.
138
+ // It will just increase bundle size without offering good debug experience.
139
+ logger.warn('Components styles sourcemaps are not generated when styles optimization is enabled.');
140
+ componentsSourceMap = false;
141
+ }
142
+ else if (buildOptions.sourceMap.hidden) {
143
+ // Inline all sourcemap types except hidden ones, which are the same as no sourcemaps
144
+ // for component css.
145
+ logger.warn('Components styles sourcemaps are not generated when sourcemaps are hidden.');
146
+ componentsSourceMap = false;
147
+ }
148
+ }
142
149
  // extract global css from js files into own css file.
143
150
  extraPlugins.push(new mini_css_extract_plugin_1.default({ filename: `[name]${hashFormat.extract}.css` }));
144
151
  if (!buildOptions.hmr) {
@@ -33,3 +33,8 @@ export declare function globalScriptsByBundleName(scripts: ScriptElement[]): {
33
33
  }[];
34
34
  export declare function assetPatterns(root: string, assets: AssetPatternClass[]): ObjectPattern[];
35
35
  export declare function getStatsOptions(verbose?: boolean): WebpackStatsOptions;
36
+ /**
37
+ * @param root the workspace root
38
+ * @returns `true` when `@angular/platform-server` is installed.
39
+ */
40
+ export declare function isPlatformServerInstalled(root: string): boolean;
@@ -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.getStatsOptions = exports.assetPatterns = exports.globalScriptsByBundleName = exports.getCacheSettings = exports.normalizeGlobalStyles = exports.getInstrumentationExcludedPaths = exports.assetNameTemplateFactory = exports.normalizeExtraEntryPoints = exports.getOutputHashFormat = void 0;
36
+ exports.isPlatformServerInstalled = exports.getStatsOptions = exports.assetPatterns = exports.globalScriptsByBundleName = exports.getCacheSettings = exports.normalizeGlobalStyles = exports.getInstrumentationExcludedPaths = exports.assetNameTemplateFactory = exports.normalizeExtraEntryPoints = exports.getOutputHashFormat = void 0;
37
37
  const crypto_1 = require("crypto");
38
38
  const glob_1 = __importDefault(require("glob"));
39
39
  const path = __importStar(require("path"));
@@ -278,3 +278,17 @@ function getStatsOptions(verbose = false) {
278
278
  : webpackOutputOptions;
279
279
  }
280
280
  exports.getStatsOptions = getStatsOptions;
281
+ /**
282
+ * @param root the workspace root
283
+ * @returns `true` when `@angular/platform-server` is installed.
284
+ */
285
+ function isPlatformServerInstalled(root) {
286
+ try {
287
+ require.resolve('@angular/platform-server', { paths: [root] });
288
+ return true;
289
+ }
290
+ catch {
291
+ return false;
292
+ }
293
+ }
294
+ exports.isPlatformServerInstalled = isPlatformServerInstalled;