@tmbr/bundler 1.11.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # TMBR Bundler
2
2
 
3
- A configurable JavaScript and [SASS](https://sass-lang.com/documentation/) 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.
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 --save-dev @tmbr/bundler
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 builds:
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
+ ![Watch command example](./screenshot.png)
30
+
29
31
  ## Configuration
30
32
 
31
- More information coming soon!
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/cli.js CHANGED
@@ -34,7 +34,7 @@ const logger = (options = {}) => ({
34
34
 
35
35
  if (result.warnings.length || result.errors.length) {
36
36
  console.log('\x07');
37
- return
37
+ return;
38
38
  }
39
39
 
40
40
  const css = `${path}/${slug}.css`;
@@ -59,6 +59,11 @@ const buildOptions = {
59
59
  sourcemap: false,
60
60
  treeShaking: true,
61
61
  legalComments: 'none',
62
+ loader: {
63
+ '.glsl': 'text',
64
+ '.vert': 'text',
65
+ '.frag': 'text',
66
+ },
62
67
  plugins: [
63
68
  styles({sourceMap: false, logger: sass.Logger.silent}),
64
69
  logger()
@@ -77,7 +82,7 @@ const watchOptions = Object.assign({}, buildOptions, {
77
82
 
78
83
  const serveOptions = {
79
84
  proxy: `${process.env.npm_package_name}.test`,
80
- files: ['assets/**', 'build/*', '**/*.php'],
85
+ files: ['assets/**', 'build/*', '**/*.php', '**/*.html'],
81
86
  host: 'localhost',
82
87
  open: false,
83
88
  notify: false,
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@tmbr/bundler",
3
3
  "type": "module",
4
- "version": "1.11.0",
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.2",
12
- "chalk": "^5.3.0",
13
- "esbuild": "^0.19.11",
14
- "esbuild-sass-plugin": "^2.16.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