@tmbr/bundler 1.5.2 → 1.6.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.
Files changed (2) hide show
  1. package/cli.js +5 -29
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -48,16 +48,6 @@ function entryPoints(suffix = '') {
48
48
  }, {});
49
49
  }
50
50
 
51
- const assets = (options = {}) => ({
52
- name: 'assets',
53
- setup(build) {
54
- build.onResolve({filter: /..\/(assets|fonts|images)\//}, args => ({
55
- path: args.path,
56
- external: true
57
- }))
58
- },
59
- });
60
-
61
51
  const errors = (options = {}) => ({
62
52
  name: 'errors',
63
53
  setup(build) {
@@ -69,18 +59,17 @@ const errors = (options = {}) => ({
69
59
 
70
60
  const defaults = {
71
61
  watch: command === 'watch',
62
+ alias: {'~': path.resolve(dir, 'src')},
72
63
  outdir: path.resolve(dir, 'build'),
73
64
  bundle: true,
74
65
  minify: true,
66
+ external: ['../assets/*', '../fonts/*', '../images/*'],
75
67
  sourcemap: false,
76
68
  logLevel: 'warning',
77
69
  legalComments: 'none',
78
70
  treeShaking: true,
79
71
  target: 'es2019',
80
- plugins: [
81
- styles({sourceMap: true}),
82
- assets(),
83
- ],
72
+ plugins: [styles({sourceMap: true})],
84
73
  };
85
74
 
86
75
  const watchConfig = Object.assign({}, defaults, {
@@ -88,10 +77,7 @@ const watchConfig = Object.assign({}, defaults, {
88
77
  minify: false,
89
78
  sourcemap: 'inline',
90
79
  logLevel: 'silent',
91
- plugins: [
92
- ...defaults.plugins,
93
- errors()
94
- ],
80
+ plugins: [...defaults.plugins, errors()],
95
81
  });
96
82
 
97
83
  const buildConfig = Object.assign({}, defaults, {
@@ -104,24 +90,14 @@ esbuild.build(buildConfig).catch(noop);
104
90
 
105
91
  if (command === 'watch') {
106
92
 
107
- const watchedBuilds = Object.keys(watchConfig.entryPoints).map(name => (
108
- `${watchConfig.outdir}/${name}.*`
109
- ));
110
-
111
- const files = [
112
- ...watchedBuilds,
113
- 'images/*',
114
- '**/*.php'
115
- ];
116
-
117
93
  const options = {
118
94
  proxy: `${package.name}.test`,
95
+ files: ['build/*', '**/*.php'],
119
96
  host: 'localhost',
120
97
  open: false,
121
98
  notify: false,
122
99
  logLevel: 'silent',
123
100
  ui: false,
124
- files
125
101
  };
126
102
 
127
103
  server.init(options, ok);
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.5.2",
4
+ "version": "1.6.0",
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,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "browser-sync": "^2.27.10",
13
13
  "chalk": "^4.1.2",
14
- "esbuild": "^0.15.5",
14
+ "esbuild": "^0.16.10",
15
15
  "esbuild-sass-plugin": "^2.3.2",
16
16
  "qrcode-terminal": "^0.12.0"
17
17
  }