Skip to content

Commit 7cc8261

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): avoid implicit CSS file extensions 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)
1 parent ea843eb commit 7cc8261

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/stylesheets/bundle-options.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ export function createStylesheetBundleOptions(
8484
publicPath: options.publicPath,
8585
conditions: ['style', 'sass', 'less'],
8686
mainFields: ['style', 'sass'],
87+
// Unlike JS, CSS does not have implicit file extensions in the general case.
88+
// Preprocessor specific behavior is handled in each stylesheet language plugin.
89+
resolveExtensions: [],
8790
plugins,
8891
};
8992
}

0 commit comments

Comments
 (0)