@m00rl0ck/simple-builder 1.0.3 ā 1.0.4
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.
- package/dev-server.js +0 -27
- package/index.js +5 -1
- package/package.json +1 -1
package/dev-server.js
CHANGED
|
@@ -95,33 +95,6 @@ function triggerReload() {
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
// ======================
|
|
99
|
-
// š WATCH
|
|
100
|
-
// ======================
|
|
101
|
-
|
|
102
|
-
function watch() {
|
|
103
|
-
const SRC_DIR = path.join(ROOT, 'src');
|
|
104
|
-
|
|
105
|
-
build();
|
|
106
|
-
|
|
107
|
-
fs.watch(SRC_DIR, { recursive: true }, () => {
|
|
108
|
-
console.log('š Rebuilding...');
|
|
109
|
-
build();
|
|
110
|
-
triggerReload();
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// ======================
|
|
115
|
-
// š BUILD
|
|
116
|
-
// ======================
|
|
117
|
-
export function build({ watch }) {
|
|
118
|
-
if (!!watch) {
|
|
119
|
-
return watch();
|
|
120
|
-
} else {
|
|
121
|
-
return build();
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
98
|
// ======================
|
|
126
99
|
// š SERVER
|
|
127
100
|
// ======================
|
package/index.js
CHANGED
|
@@ -117,7 +117,11 @@ function watch() {
|
|
|
117
117
|
// š BUILD
|
|
118
118
|
// ======================
|
|
119
119
|
|
|
120
|
-
export function build() {
|
|
120
|
+
export function build({ watch }) {
|
|
121
|
+
if (watch) {
|
|
122
|
+
return watch();
|
|
123
|
+
}
|
|
124
|
+
|
|
121
125
|
console.log(`\nš Build started (${isProd ? 'production' : 'development'})`);
|
|
122
126
|
|
|
123
127
|
cleanDist();
|