Skip to content

Commit 7a869f9

Browse files
authored
Merge pull request #593 from HelixDesignSystem/tweak-watch-globs
chore(pipeline): tweak watch globs
2 parents 860376d + 1e8828a commit 7a869f9

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

scripts/start.js

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,43 @@ browserSync.init({
5757
}, 1500),
5858
},
5959

60-
// Recompile toolkit scripts if any JS file changes in source directory
6160
{
6261
match: [
63-
`${CONFIG.sourceDir}/*.js`,
62+
// ANY JavaScript file change should trigger a recompile
63+
//
64+
// example:
65+
// - src/index.js
66+
// - src/_bundle.umd.js
67+
// - src/elements/index.js
6468
`${CONFIG.sourceDir}/**/*.js`,
65-
// OLD Shadow DOM
66-
`${CONFIG.sourceDir}/elements/*.less`, // (+) ShadowDOM CSS
67-
`${CONFIG.sourceDir}/elements/*.html`, // (+) ShadowDOM Markup
68-
// NEW Shadow DOM
69-
`${CONFIG.sourceDir}/elements/**/_shadow.*`,
69+
70+
// ANY custom element source file should trigger a recompile,
71+
// because they all contribute to JavaScript assets.
72+
//
73+
// example:
74+
// - src/elements/_base.less
75+
// - src/elements/hx-icon/_shadow.html
76+
// - src/elements/hx-accordion-panel/_shadow.scss
77+
`${CONFIG.sourceDir}/elements/**/*`,
78+
79+
// ANY icon change should trigger a recompile,
80+
// because they all contribute to JavaScript assets.
81+
`${CONFIG.sourceDir}/images/icons/*`,
82+
83+
// ignore changes to test files
84+
`!${CONFIG.sourceDir}/**/*.spec.js`,
7085
],
7186
fn: _.debounce(compileScripts, 1500),
7287
},
7388

7489
// Generate API docs when src files change
7590
{
7691
match: [
77-
`${CONFIG.sourceDir}/*.js`,
92+
// ANY JavaScript file in the src/ directory should
93+
// trigger generation of API docs...
7894
`${CONFIG.sourceDir}/**/*.js`,
79-
`${CONFIG.sourceDir}/*.md`,
80-
`${CONFIG.sourceDir}/**/*.md`,
95+
// ... excluding spec files
96+
`!${CONFIG.sourceDir}/**/*.spec.js`,
8197
],
8298
fn: _.debounce(generateApis, 1500),
8399
},

0 commit comments

Comments
 (0)