rolldown-plugin-require-cjs 0.1.1 → 0.1.2

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/dist/index.js +5 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10862,13 +10862,15 @@ function parseAst(sourceText, options, filename) {
10862
10862
  //#endregion
10863
10863
  //#region src/options.ts
10864
10864
  function resolveOptions(options) {
10865
- let { shouldTransform } = options;
10866
- if (Array.isArray(shouldTransform)) shouldTransform = (id) => shouldTransform.includes(id);
10865
+ if (Array.isArray(options.shouldTransform)) {
10866
+ const { shouldTransform } = options;
10867
+ options.shouldTransform = (id) => shouldTransform.includes(id);
10868
+ }
10867
10869
  return {
10868
10870
  include: options.include || [/\.[cm]?[jt]sx?$/],
10869
10871
  exclude: options.exclude || [/node_modules/, /\.d\.[cm]?ts$/],
10870
10872
  order: "order" in options ? options.order : "pre",
10871
- shouldTransform
10873
+ shouldTransform: options.shouldTransform
10872
10874
  };
10873
10875
  }
10874
10876
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-plugin-require-cjs",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Transform ESM imports to CJS requires when the imported module is pure CJS.",
5
5
  "type": "module",
6
6
  "license": "MIT",