Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): avoid implicit CSS file extension…
Browse files Browse the repository at this point in the history
…s when resolving

Unlike the non-ESM Node.js resolution for JS files, CSS does not have the concept
of implicit file extensions. To avoid incorrectly resolving a file as CSS,
stylesheet bundling no longer attempts to resolve implicit extensions. Preprocessors,
such as Sass, contain logic internally that handles any specific resolution cases
for their respective preprocessor and such behavior is unaffected.

(cherry picked from commit 8d1a7c3)
  • Loading branch information
clydin authored and alan-agius4 committed Mar 4, 2024
1 parent ea843eb commit 7cc8261
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ export function createStylesheetBundleOptions(
publicPath: options.publicPath,
conditions: ['style', 'sass', 'less'],
mainFields: ['style', 'sass'],
// Unlike JS, CSS does not have implicit file extensions in the general case.
// Preprocessor specific behavior is handled in each stylesheet language plugin.
resolveExtensions: [],
plugins,
};
}

0 comments on commit 7cc8261

Please sign in to comment.