@m00rl0ck/simple-builder 1.0.7 → 1.1.0

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, watch } from './index.js';
4
+ import { build } from './index.js';
5
5
 
6
6
  const PORT = 3000;
7
7
  const ROOT = process.cwd();
@@ -107,28 +107,18 @@ 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
-
124
110
  // ======================
125
111
  // ā–¶ļø START
126
112
  // ======================
127
113
 
128
- export function renServer({ isProd }) {
129
- build({ watch: true, isProd })
114
+ function runServer({ isProd }) {
115
+ const watch = !isProd;
116
+
117
+ build({ watch, isProd });
130
118
 
131
119
  server.listen(PORT, () => {
132
120
  console.log(`\nšŸš€ Dev server running: http://localhost:${PORT}\n`);
133
121
  });
134
122
  }
123
+
124
+ export { build, runServer };
package/index.js CHANGED
@@ -96,7 +96,7 @@ function buildHTML(isProd) {
96
96
  // šŸ‘€ WATCH MODE
97
97
  // ======================
98
98
 
99
- export function watch() {
99
+ function watchBuild() {
100
100
  console.log('šŸ‘€ Watch mode ON...\n');
101
101
 
102
102
  fs.watch(SRC_DIR, { recursive: true }, (eventType, filename) => {
@@ -116,7 +116,7 @@ export function watch() {
116
116
 
117
117
  export function build({ watch, isProd }) {
118
118
  if (!!watch) {
119
- return watch();
119
+ return watchBuild();
120
120
  }
121
121
 
122
122
  console.log(`\nšŸš€ Build started (${isProd} ? 'production' : 'development')`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m00rl0ck/simple-builder",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
4
4
  "description": "Zero-dependency JS and CSS bundler with dev server and minifier",
5
5
  "type": "module",
6
6
  "main": "index.js",