bun_bun_bundle 0.13.0 → 0.14.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.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/bun/bun_bundle.js +12 -7
- data/lib/bun_bun_bundle/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39edf3123436dc20c093f42cf59baa94d7cfa12b80cb1024af6fac74d872a2e9
|
|
4
|
+
data.tar.gz: 170ca35cd0f7fa6e81ac9e156ea0e2a2830edef61b54393e2c1eb8b8dd6d36c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f25361191c1840f4642af90d0cac4e6836a069d6d7850fa4ebff0721b22c5044742776d8b6719efee4c604d09e6c39406f4a0cfeaf8733402680e42bea71b98
|
|
7
|
+
data.tar.gz: 852f04b4ff3ba7cd7110bb083e8effb1d9d0f7e38584e7686afa64ac42158dec178517bce103711f385e07166bebda6b3e71fa22fba368083f9251e84b313fa5
|
data/README.md
CHANGED
|
@@ -244,6 +244,10 @@ Place a `config/bun.json` in your project root:
|
|
|
244
244
|
> Creating a `bun.json` file is entirely optional. All values shown above are
|
|
245
245
|
> defaults, you only need to specify what you want to override.
|
|
246
246
|
|
|
247
|
+
`watchDirs` entries may be glob patterns. For example, in a Hanami app with
|
|
248
|
+
multiple slices, `"slices/*/assets"` will watch every slice's assets directory
|
|
249
|
+
without having to list them explicitly.
|
|
250
|
+
|
|
247
251
|
If you're developing inside a Docker container, set `listenHost` so the
|
|
248
252
|
WebSocket server accepts connections from the host machine:
|
|
249
253
|
|
data/lib/bun/bun_bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {mkdirSync, readFileSync, existsSync, rmSync, watch} from 'fs'
|
|
1
|
+
import {mkdirSync, readFileSync, existsSync, rmSync, statSync, watch} from 'fs'
|
|
2
2
|
import {join, dirname, basename, extname} from 'path'
|
|
3
3
|
import {Glob} from 'bun'
|
|
4
4
|
import {resolvePlugins} from './plugins/index.js'
|
|
@@ -382,13 +382,18 @@ export default {
|
|
|
382
382
|
})()
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
for (const
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
385
|
+
for (const pattern of this.config.watchDirs) {
|
|
386
|
+
const dirs = pattern.includes('*')
|
|
387
|
+
? await Array.fromAsync(new Glob(pattern).scan({cwd: this.root, onlyFiles: false}))
|
|
388
|
+
: [pattern]
|
|
389
|
+
for (const dir of dirs) {
|
|
390
|
+
const fullDir = join(this.root, dir)
|
|
391
|
+
if (!existsSync(fullDir) || !statSync(fullDir).isDirectory()) {
|
|
392
|
+
console.warn(` ▸ Watch directory ${dir} does not exist, skipping...`)
|
|
393
|
+
continue
|
|
394
|
+
}
|
|
395
|
+
this.watchers.push(watch(fullDir, {recursive: true}, handler))
|
|
390
396
|
}
|
|
391
|
-
this.watchers.push(watch(fullDir, {recursive: true}, handler))
|
|
392
397
|
}
|
|
393
398
|
|
|
394
399
|
console.log('Beginning to watch your project')
|