generator-reshow 0.17.19 → 0.17.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ DIR=$(
6
6
  )
7
7
  cd $DIR
8
8
  SWJS=${DIR}/service-worker.js
9
+ webpackEnabled=$(awk -F "=" '/^webpackEnabled/ {print $2}' $DIR/.yo)
9
10
 
10
11
  conf='{'
11
12
  conf+='"assetsRoot":"/assets/",'
@@ -22,7 +23,7 @@ if [ -z "$OPEN" ]; then
22
23
  OPEN="open"
23
24
  fi
24
25
 
25
- if [ "x<%= webpackEnabled %>" == "xon" ]; then
26
+ if [ "x$webpackEnabled" == "xon" ]; then
26
27
  webpack='npm run webpack --'
27
28
  fi
28
29
 
@@ -40,8 +41,10 @@ killBy() {
40
41
 
41
42
  stop() {
42
43
  killBy ${DIR}/node_modules/.bin/babel
43
- cat webpack.pid | xargs -I{} kill -9 {}
44
- npm run clean:webpack
44
+ if [ ! -z "$webpack" ]; then
45
+ cat webpack.pid | xargs -I{} kill -9 {}
46
+ npm run clean:webpack
47
+ fi
45
48
  rm $SWJS
46
49
  echo "Stop done"
47
50
  }
@@ -73,7 +76,9 @@ production() {
73
76
  echo "Production Mode"
74
77
  checkBabel
75
78
  npm run build
76
- ENABLE_SW=1 CONFIG=$conf NODE_ENV=production $webpack
79
+ if [ ! -z "$webpack" ]; then
80
+ ENABLE_SW=1 CONFIG=$conf NODE_ENV=production $webpack
81
+ fi
77
82
  }
78
83
 
79
84
  analyzer() {
@@ -81,7 +86,7 @@ analyzer() {
81
86
  echo "Analyzer Mode"
82
87
  checkBabel
83
88
  npm run build
84
- CONFIG=$conf BUNDLE='{}' $webpack
89
+ [ ! -z "$webpack" ] && CONFIG=$conf BUNDLE='{}' $webpack
85
90
  }
86
91
 
87
92
  develop() {
@@ -89,7 +94,7 @@ develop() {
89
94
  echo "Develop Mode"
90
95
  checkBabel
91
96
  npm run build
92
- CONFIG=$conf $webpack
97
+ [ ! -z "$webpack" ] && CONFIG=$conf $webpack
93
98
  }
94
99
 
95
100
  watch() {
@@ -98,16 +103,6 @@ watch() {
98
103
  checkBabel
99
104
  npm run build:es:ui -- --watch &
100
105
  npm run build:es:src -- --watch &
101
- sleep 10
102
- CONFIG=$conf $webpack --watch &
103
- }
104
-
105
- watchTest() {
106
- stop
107
- echo "Watch Test"
108
- checkBabel
109
- npm run build:cjs:ui -- --watch &
110
- npm run build:cjs:src -- --watch &
111
106
  }
112
107
 
113
108
  hot() {
@@ -117,8 +112,7 @@ hot() {
117
112
  checkBabel
118
113
  npm run build:es:ui -- --watch &
119
114
  npm run build:es:src -- --watch &
120
- sleep 10
121
- HOT_UPDATE=1 CONFIG=$conf $webpack serve &
115
+ [ ! -z "$webpack" ] && sleep 10 && HOT_UPDATE=1 CONFIG=$conf $webpack serve &
122
116
  }
123
117
 
124
118
  case "$1" in
@@ -140,9 +134,6 @@ case "$1" in
140
134
  watch)
141
135
  watch
142
136
  ;;
143
- watchTest)
144
- watchTest
145
- ;;
146
137
  stop)
147
138
  stop
148
139
  ;;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-reshow",
3
- "version": "0.17.19",
3
+ "version": "0.17.20",
4
4
  "description": "Yeoman generator for reshow. (app, generator, ...etc)",
5
5
  "author": "Hill <hill@kimo.com>",
6
6
  "repository": {