bundlebee 1.0.2 → 1.0.4

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/index.js +8 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -203,7 +203,7 @@ module.exports = class Bundlebee extends ReadyResource {
203
203
  for (const [k, v] of Object.entries(resolutions)) {
204
204
  const skip = peerDeps && peerDeps.has(k)
205
205
  const nm =
206
- (v.startsWith('/node_modules') && skipModules) || skip ? findModule(cache, v, root) : null
206
+ (v.includes('node_modules/') && skipModules) || skip ? findModule(cache, v, root) : null
207
207
  if (nm) {
208
208
  m[k] = 'bundle://host' + v
209
209
  bundleCache[m[k]] = nm
@@ -226,7 +226,6 @@ module.exports = class Bundlebee extends ReadyResource {
226
226
  if (!root.pathname.endsWith('/')) root = new URL('./', root)
227
227
  if (peerDependencies) peerDependencies = new Set(peerDependencies)
228
228
 
229
- const nodeModules = new URL('./node_modules', root)
230
229
  const bundle = new Bundle()
231
230
 
232
231
  const resolutions = {}
@@ -237,11 +236,11 @@ module.exports = class Bundlebee extends ReadyResource {
237
236
  readModule,
238
237
  listPrefix
239
238
  )) {
240
- if (dependency.url.href.startsWith(nodeModules.href)) {
239
+ if (dependency.url.href.includes('/node_modules/')) {
241
240
  if (skipModules) continue
242
241
  if (peerDependencies) {
243
242
  const moduleName = dependency.url.pathname
244
- .replace(root.pathname + 'node_modules/', '')
243
+ .slice(dependency.url.pathname.lastIndexOf('node_modules/') + 13)
245
244
  .split('/')[0]
246
245
  if (peerDependencies.has(moduleName)) continue
247
246
  }
@@ -287,6 +286,11 @@ module.exports = class Bundlebee extends ReadyResource {
287
286
  }
288
287
 
289
288
  const w = this._bee.write()
289
+
290
+ // for await (const { key } of this._bee.createReadStream()) {
291
+ // w.tryDelete(key)
292
+ // }
293
+
290
294
  for (const f in data.bundle.files) {
291
295
  w.tryPut(
292
296
  b4a.from(f),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bundlebee",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "bundlebee",
5
5
  "main": "index.js",
6
6
  "imports": {