@m00rl0ck/simple-builder 1.0.6 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import http from 'http';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
- import { build } from './index.js';
4
+ import { build, watch } from './index.js';
5
5
 
6
6
  const PORT = 3000;
7
7
  const ROOT = process.cwd();
@@ -107,6 +107,20 @@ const server = http.createServer((req, res) => {
107
107
  serveFile(req, res);
108
108
  });
109
109
 
110
+
111
+ // ======================
112
+ // 🚀 Build
113
+ // ======================
114
+
115
+ export function build({ watch, isProd }) {
116
+ if (!!watch) {
117
+ return watch();
118
+ } else {
119
+ return build({ isProd });
120
+ }
121
+ }
122
+
123
+
110
124
  // ======================
111
125
  // ▶️ START
112
126
  // ======================
package/index.js CHANGED
@@ -96,7 +96,7 @@ function buildHTML(isProd) {
96
96
  // 👀 WATCH MODE
97
97
  // ======================
98
98
 
99
- function watch() {
99
+ export function watch() {
100
100
  console.log('👀 Watch mode ON...\n');
101
101
 
102
102
  fs.watch(SRC_DIR, { recursive: true }, (eventType, filename) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m00rl0ck/simple-builder",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Zero-dependency JS and CSS bundler with dev server and minifier",
5
5
  "type": "module",
6
6
  "main": "index.js",