@tmbr/bundler 1.2.0 → 1.2.1
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/cli.js +3 -52
- package/package.json +3 -3
package/cli.js
CHANGED
|
@@ -3,8 +3,8 @@ const esbuild = require('esbuild');
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const exec = require('child_process').execSync;
|
|
5
5
|
const styles = require('esbuild-sass-plugin').sassPlugin;
|
|
6
|
+
const qrcode = require('qrcode-terminal');
|
|
6
7
|
const chalk = require('chalk');
|
|
7
|
-
const qr = require('qrcode-terminal');
|
|
8
8
|
const bs = require('browser-sync').create();
|
|
9
9
|
const renderError = require('./error');
|
|
10
10
|
|
|
@@ -20,50 +20,6 @@ if (!['build', 'watch'].includes(command)) {
|
|
|
20
20
|
|
|
21
21
|
exec(`rm -rf ${cwd}/build/*`);
|
|
22
22
|
|
|
23
|
-
/* const logger = (options = {}) => ({
|
|
24
|
-
name: 'logger',
|
|
25
|
-
setup(build) {
|
|
26
|
-
|
|
27
|
-
let info;
|
|
28
|
-
// const cache = new Map;
|
|
29
|
-
|
|
30
|
-
function reset() {
|
|
31
|
-
console.clear();
|
|
32
|
-
info.external && console.log(info.qrcode);
|
|
33
|
-
console.log(`Proxying: ${chalk.green(info.proxying)}`);
|
|
34
|
-
console.log(`External: ${chalk.cyan(info.external || 'offline')}`);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
build.onEnd(() => {
|
|
38
|
-
|
|
39
|
-
if (typeof info === 'undefined') {
|
|
40
|
-
|
|
41
|
-
const host = bs.getOption('proxy').get('target');
|
|
42
|
-
const port = bs.getOption('port');
|
|
43
|
-
|
|
44
|
-
info = {};
|
|
45
|
-
info.proxying = `${host}:${port}`;
|
|
46
|
-
info.external = bs.getOption('urls').get('external');
|
|
47
|
-
|
|
48
|
-
info.external && qr.generate(info.external, {small: true}, qrcode => {
|
|
49
|
-
info.qrcode = qrcode;
|
|
50
|
-
reset();
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
error = result.errors[0];
|
|
57
|
-
|
|
58
|
-
if (error) {
|
|
59
|
-
bs.reload();
|
|
60
|
-
} else {
|
|
61
|
-
reset();
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}); */
|
|
66
|
-
|
|
67
23
|
const assets = (options = {}) => ({
|
|
68
24
|
name: 'assets',
|
|
69
25
|
setup(build) {
|
|
@@ -77,7 +33,6 @@ const assets = (options = {}) => ({
|
|
|
77
33
|
const errors = (options = {}) => ({
|
|
78
34
|
name: 'errors',
|
|
79
35
|
setup(build) {
|
|
80
|
-
|
|
81
36
|
build.onEnd(result => {
|
|
82
37
|
error = result.errors[0];
|
|
83
38
|
error && bs.reload();
|
|
@@ -87,7 +42,7 @@ const errors = (options = {}) => ({
|
|
|
87
42
|
|
|
88
43
|
function entryPoints(suffix = '') {
|
|
89
44
|
|
|
90
|
-
if (
|
|
45
|
+
if (!suffix.startsWith('.')) {
|
|
91
46
|
suffix = `.${suffix}`;
|
|
92
47
|
}
|
|
93
48
|
|
|
@@ -171,13 +126,9 @@ if (command === 'watch') {
|
|
|
171
126
|
const port = bs.getOption('port');
|
|
172
127
|
const proxying = `${host}:${port}`;
|
|
173
128
|
const external = bs.getOption('urls').get('external');
|
|
174
|
-
external && qr.generate(external, {small: true}, console.log);
|
|
175
129
|
|
|
130
|
+
external && qrcode.generate(external, {small: true}, console.log);
|
|
176
131
|
console.log(`Proxying: ${chalk.green(proxying)}`);
|
|
177
132
|
console.log(`External: ${chalk.cyan(external || 'offline')}`);
|
|
178
133
|
});
|
|
179
134
|
}
|
|
180
|
-
|
|
181
|
-
process.on('SIGINT', () => {
|
|
182
|
-
process.exit();
|
|
183
|
-
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmbr/bundler",
|
|
3
3
|
"author": "TMBR (https://wearetmbr.com/)",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/TMBR/tmbr-bundler",
|
|
7
7
|
"description": "WordPress development toolkit built on esbuild and browser-sync",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"browser-sync": "^2.27.5",
|
|
13
13
|
"chalk": "^4.1.2",
|
|
14
|
-
"esbuild": "^0.14.
|
|
15
|
-
"esbuild-sass-plugin": "^2.2.
|
|
14
|
+
"esbuild": "^0.14.47",
|
|
15
|
+
"esbuild-sass-plugin": "^2.2.6",
|
|
16
16
|
"html-entities": "^2.3.2",
|
|
17
17
|
"qrcode-terminal": "^0.12.0"
|
|
18
18
|
}
|