File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ const DIST = 'assets/js/dist';
11
11
const banner = `/*!
12
12
* ${ pkg . name } v${ pkg . version } | © ${ pkg . since } ${ pkg . author } | ${ pkg . license } Licensed | ${ pkg . homepage }
13
13
*/` ;
14
-
15
14
const frontmatter = `---\npermalink: /:basename\n---\n` ;
16
-
17
15
const isProd = process . env . BUILD === 'production' ;
18
16
17
+ let hasWatched = false ;
18
+
19
19
function cleanup ( ) {
20
20
fs . rmSync ( DIST , { recursive : true , force : true } ) ;
21
21
console . log ( `> Directory "${ DIST } " has been cleaned.` ) ;
@@ -39,6 +39,11 @@ function build(
39
39
{ src = SRC_DEFAULT , jekyll = false , outputName = null } = { }
40
40
) {
41
41
const input = `${ src } /${ filename } .js` ;
42
+ const shouldWatch = hasWatched ? false : true ;
43
+
44
+ if ( ! hasWatched ) {
45
+ hasWatched = true ;
46
+ }
42
47
43
48
return {
44
49
input,
@@ -49,9 +54,7 @@ function build(
49
54
banner,
50
55
sourcemap : ! isProd && ! jekyll
51
56
} ,
52
- watch : {
53
- include : input
54
- } ,
57
+ ...( shouldWatch && { watch : { include : `${ SRC_DEFAULT } /**/*.js` } } ) ,
55
58
plugins : [
56
59
babel ( {
57
60
babelHelpers : 'bundled' ,
You can’t perform that action at this time.
0 commit comments