Skip to content

Commit 5793d7f

Browse files
Merge pull request #1144 from JosefBredereck/feature-server-asset-change
Update server to support asset change detection
2 parents c4061c2 + 6d90e3b commit 5793d7f

File tree

3 files changed

+174
-127
lines changed

3 files changed

+174
-127
lines changed

packages/core/src/lib/server.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,30 @@ const server = patternlab => {
3636
patternlab.config.paths.public.root
3737
)
3838
);
39+
defaults.assets = [
40+
path.resolve(
41+
path.join(
42+
process.cwd(),
43+
patternlab.config.paths.source.js,
44+
'**',
45+
'*.js' // prevent preprocessors like typescript from reloading
46+
)
47+
),
48+
path.resolve(
49+
path.join(process.cwd(), patternlab.config.paths.source.images)
50+
),
51+
path.resolve(
52+
path.join(process.cwd(), patternlab.config.paths.source.fonts)
53+
),
54+
path.resolve(
55+
path.join(
56+
process.cwd(),
57+
patternlab.config.paths.source.css,
58+
'**',
59+
'*.css' // prevent preprocessors from reloading
60+
)
61+
),
62+
];
3963

4064
// allow for overrides should they exist inside patternlab-config.json
4165
const liveServerConfig = Object.assign(

packages/edition-node-gulp/gulpfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function serve() {
2727
return patternlab.server
2828
.serve({
2929
cleanPublic: config.cleanPublic,
30+
watch: true,
3031
})
3132
.then(() => {
3233
// do something else when this promise resolves

0 commit comments

Comments
 (0)