@tmbr/bundler 1.12.0 → 1.12.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/README.md +27 -4
- package/package.json +5 -5
- package/screenshot.png +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TMBR Bundler
|
|
2
2
|
|
|
3
|
-
A configurable JavaScript and
|
|
3
|
+
A configurable JavaScript and SASS bundler built on [esbuild](https://esbuild.github.io) and [browser-sync](https://browsersync.io). Intended for WordPress development or projects where a CI/CD workflow is not available, allowing for concurrent development and production bundles.
|
|
4
4
|
|
|
5
5
|
**Why [esbuild](https://esbuild.github.io)?**
|
|
6
6
|
|
|
@@ -9,11 +9,11 @@ Compared to the mess of webpack loaders and dependencies, esbuild is faster, has
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install
|
|
12
|
+
npm install -D @tmbr/bundler
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
|
-
`@tmbr/bundler` has two commands - `build` and `watch` - that both create concurrent
|
|
16
|
+
`@tmbr/bundler` has two commands - `build` and `watch` - that both create concurrent bundles:
|
|
17
17
|
- `build/main.dev.[css|js]` development version with sourcemaps
|
|
18
18
|
- `build/main.min.[css|js]` minified production version
|
|
19
19
|
|
|
@@ -26,6 +26,29 @@ This command creates the build files noted above and displays KB sizes for the m
|
|
|
26
26
|
This command will create initial build files noted above and start watching for changes. By default, it will look at the **name** field in your `package.json` file, append `.test` and proxy
|
|
27
27
|
`http://example.test:3000` for auto-reloading.
|
|
28
28
|
|
|
29
|
+

|
|
30
|
+
|
|
29
31
|
## Configuration
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
A second argument can be passed after `build` or `watch` to allow for overriding the default options. This should be a relative path to a file that includes named exports for build, watch and / or serve. If an export returns an object, it will be shallow merged into the bundler's options. Alternatively, an exported function will receive the default options and expect a returned object.
|
|
34
|
+
|
|
35
|
+
`bundler watch bundler.config.js`<br>`bundler build bundler.config.js`
|
|
36
|
+
|
|
37
|
+
### Examples
|
|
38
|
+
|
|
39
|
+
#### Change output directory
|
|
40
|
+
```js
|
|
41
|
+
export const build = {
|
|
42
|
+
outdir: 'dist'
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const watch = {
|
|
46
|
+
outdir: 'dist'
|
|
47
|
+
};
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### Change [browser-sync](https://browsersync.io/docs/options) options
|
|
51
|
+
```js
|
|
52
|
+
export const serve = {
|
|
53
|
+
port: 5000
|
|
54
|
+
};
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmbr/bundler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.12.
|
|
4
|
+
"version": "1.12.1",
|
|
5
5
|
"repository": "github:TMBR/tmbr-bundler",
|
|
6
6
|
"bin": {
|
|
7
7
|
"bundler": "cli.js",
|
|
8
8
|
"tmbr-bundler": "cli.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"browser-sync": "^3.0.
|
|
12
|
-
"chalk": "^5.
|
|
13
|
-
"esbuild": "^0.
|
|
14
|
-
"esbuild-sass-plugin": "^3.1
|
|
11
|
+
"browser-sync": "^3.0.3",
|
|
12
|
+
"chalk": "^5.4.1",
|
|
13
|
+
"esbuild": "^0.25.0",
|
|
14
|
+
"esbuild-sass-plugin": "^3.3.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
package/screenshot.png
ADDED
|
Binary file
|