@jsenv/plugin-bundling 2.1.5 → 2.1.7

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-bundling",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "https://github.com/jsenv/jsenv-core",
7
+ "url": "https://github.com/jsenv/core",
8
8
  "directory": "packages/jsenv-plugin-bundling"
9
9
  },
10
10
  "publishConfig": {
@@ -24,14 +24,14 @@
24
24
  "test": "node --conditions=development ./scripts/test.mjs"
25
25
  },
26
26
  "dependencies": {
27
- "@jsenv/babel-plugins": "1.1.5",
27
+ "@jsenv/babel-plugins": "1.1.6",
28
28
  "@jsenv/log": "3.3.4",
29
29
  "@jsenv/url-meta": "8.1.0",
30
30
  "@jsenv/urls": "2.0.0",
31
31
  "@jsenv/sourcemap": "1.0.10",
32
32
  "acorn-import-assertions": "1.8.0",
33
- "lightningcss": "1.19.0",
34
- "rollup": "3.20.2"
33
+ "lightningcss": "1.20.0",
34
+ "rollup": "3.21.3"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@jsenv/core": "*"
@@ -15,6 +15,7 @@ export const bundleJsModules = async ({
15
15
  chunks = {},
16
16
  strictExports = false,
17
17
  preserveDynamicImport = false,
18
+ augmentDynamicImportUrlSearchParams = () => {},
18
19
  rollup,
19
20
  rollupInput = {},
20
21
  rollupOutput = {},
@@ -73,6 +74,7 @@ export const bundleJsModules = async ({
73
74
  sourcemaps,
74
75
  include,
75
76
  preserveDynamicImport,
77
+ augmentDynamicImportUrlSearchParams,
76
78
  strictExports,
77
79
  resultRef,
78
80
  }),
@@ -141,6 +143,7 @@ const rollupPluginJsenv = ({
141
143
 
142
144
  include,
143
145
  preserveDynamicImport,
146
+ augmentDynamicImportUrlSearchParams,
144
147
  strictExports,
145
148
 
146
149
  resultRef,
@@ -298,7 +301,17 @@ const rollupPluginJsenv = ({
298
301
  }
299
302
  urlObject = new URL(specifier, importer)
300
303
  }
301
- urlObject.searchParams.set("as_js_classic_library", "")
304
+ const searchParamsToAdd = augmentDynamicImportUrlSearchParams(urlObject)
305
+ if (searchParamsToAdd) {
306
+ Object.keys(searchParamsToAdd).forEach((key) => {
307
+ const value = searchParamsToAdd[key]
308
+ if (value === undefined) {
309
+ urlObject.searchParams.delete(key)
310
+ } else {
311
+ urlObject.searchParams.set(key, value)
312
+ }
313
+ })
314
+ }
302
315
  return { external: true, id: urlObject.href }
303
316
  }
304
317
  return null