@@ -27,9 +27,8 @@ const themingEntryPointPath = join(COMPONENTS_DIR, 'core', 'theming', '_all-them
27
27
// Output path for the scss theming bundle.
28
28
const themingBundlePath = join ( releasePath , '_theming.scss' ) ;
29
29
30
- // Glob that matches all files that might be imported multiple times.
31
- // Necessary for deduping inside of scss-bundle.
32
- const themingBundleDedupeGlob = join ( COMPONENTS_DIR , '**/*.scss' ) ;
30
+ // Matches all SCSS files in the library.
31
+ const allScssGlob = join ( COMPONENTS_DIR , '**/*.scss' ) ;
33
32
34
33
// Matches all pre-built theme css files
35
34
const prebuiltThemeGlob = join ( DIST_MATERIAL , '**/theming/prebuilt/*.css' ) ;
@@ -51,7 +50,10 @@ task(':package:theming', [':bundle:theming-scss'], () => {
51
50
52
51
/** Bundles all scss requires for theming into a single scss file in the root of the package. */
53
52
task ( ':bundle:theming-scss' , ( ) => {
54
- new Bundler ( ) . Bundle ( themingEntryPointPath , [ themingBundleDedupeGlob ] ) . then ( result => {
53
+ // Instantiates the SCSS bundler and bundles all imports of the specified entry point SCSS file.
54
+ // A glob of all SCSS files in the library will be passed to the bundler. The bundler takes an
55
+ // array of globs, which will match SCSS files that will be only included once in the bundle.
56
+ new Bundler ( ) . Bundle ( themingEntryPointPath , [ allScssGlob ] ) . then ( result => {
55
57
writeFileSync ( themingBundlePath , result . bundledContent ) ;
56
58
} ) ;
57
59
} ) ;
0 commit comments