Skip to content

Commit 9f5c143

Browse files
committed
fix(serve): Reference events by constants
1 parent 48f0190 commit 9f5c143

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/lib/serve.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22
const path = require('path');
33
const liveServer = require('@pattern-lab/live-server');
4+
5+
const events = require('./events');
46
const logger = require('./log');
57

68
const serve = patternlab => {
@@ -25,7 +27,7 @@ const serve = patternlab => {
2527
);
2628

2729
// watch for asset changes, and reload appropriately
28-
patternlab.events.on('patternlab-asset-change', data => {
30+
patternlab.events.on(events.PATTERNLAB_PATTERN_ASSET_CHANGE, data => {
2931
if (serverReady) {
3032
if (data.file.indexOf('css') > -1) {
3133
liveServer.refreshCSS();
@@ -36,7 +38,7 @@ const serve = patternlab => {
3638
});
3739

3840
//watch for pattern changes, and reload
39-
patternlab.events.on('patternlab-pattern-change', () => {
41+
patternlab.events.on(events.PATTERNLAB_PATTERN_CHANGE, () => {
4042
if (serverReady) {
4143
liveServer.reload();
4244
}

0 commit comments

Comments
 (0)