@jsenv/plugin-commonjs 2.8.28 → 2.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-commonjs",
3
- "version": "2.8.28",
3
+ "version": "2.9.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "cjs-module-lexer": "1.4.1",
33
33
  "is-valid-identifier": "2.0.2",
34
34
  "resolve": "1.22.8",
35
- "rollup": "4.24.3",
35
+ "rollup": "4.24.4",
36
36
  "rollup-plugin-node-globals": "1.4.0",
37
37
  "rollup-plugin-polyfill-node": "0.13.0"
38
38
  }
@@ -78,17 +78,13 @@ export const jsenvPluginCommonJs = ({
78
78
  return turnIntoJsModuleProxy(reference);
79
79
  },
80
80
  fetchUrlContent: async (urlInfo) => {
81
- const commonJsUrlInfo = urlInfo.getWithoutSearchParam(
82
- "cjs_as_js_module",
83
- {
84
- // during this fetch we don't want to alter the original file
85
- // so we consider it as text
86
- expectedType: "text",
87
- },
88
- );
81
+ const commonJsUrlInfo = urlInfo.getWithoutSearchParam("cjs_as_js_module");
89
82
  if (!commonJsUrlInfo) {
90
83
  return null;
91
84
  }
85
+ // during this fetch we don't want to alter the original file
86
+ // so we consider it as text
87
+ commonJsUrlInfo.type = "text";
92
88
  await commonJsUrlInfo.cook();
93
89
  const nodeRuntimeEnabled = Object.keys(
94
90
  urlInfo.context.runtimeCompat,