Skip to content

Commit 5b0f24a

Browse files
authored
Only trigger _reactium-modules.scss update on actual DDD partial list change. (#140)
1 parent f8dcc00 commit 5b0f24a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.core/gulp.tasks.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,9 @@ $assets: (
656656
};
657657

658658
const dddStylesPartial = done => {
659+
const currentPartial =
660+
fs.existsSync(config.dest.modulesPartial) &&
661+
fs.readFileSync(config.dest.modulesPartial, 'utf8');
659662
const SassPartialRegistry = ReactiumGulp.Utils.registryFactory(
660663
'SassPartialRegistry',
661664
'id',
@@ -744,12 +747,15 @@ $assets: (
744747
{{/each}}
745748
`);
746749

747-
fs.ensureFileSync(config.dest.modulesPartial);
748-
fs.writeFileSync(
749-
config.dest.modulesPartial,
750-
template(stylePartials),
751-
'utf8',
752-
);
750+
const newPartial = template(stylePartials);
751+
if (currentPartial !== newPartial) {
752+
fs.ensureFileSync(config.dest.modulesPartial);
753+
fs.writeFileSync(
754+
config.dest.modulesPartial,
755+
template(stylePartials),
756+
'utf8',
757+
);
758+
}
753759
done();
754760
};
755761

0 commit comments

Comments
 (0)