unplugin-oxc 0.2.2 → 0.2.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.
package/dist/esbuild.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  //#region src/esbuild.ts
4
4
  /**
package/dist/farm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  //#region src/farm.ts
4
4
  /**
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ interface Options {
31
31
  /**
32
32
  * Minify options passed to `oxc-minify`
33
33
  */
34
- minify?: Omit<MinifyOptions, "sourcemap"> | false;
34
+ minify?: Omit<MinifyOptions, "sourcemap"> | boolean;
35
35
  /**
36
36
  * Default: `true` on unloader, `false` on others.
37
37
  */
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  export { Oxc };
package/dist/rolldown.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  //#region src/rolldown.ts
4
4
  /**
package/dist/rollup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  //#region src/rollup.ts
4
4
  /**
package/dist/rspack.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  //#region src/rspack.ts
4
4
  /**
@@ -1,5 +1,6 @@
1
1
  import { readFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
+ import process from "node:process";
3
4
  import { minify } from "oxc-minify";
4
5
  import { ResolverFactory } from "oxc-resolver";
5
6
  import { transform } from "oxc-transform";
@@ -27,7 +28,7 @@ const Oxc = createUnplugin((rawOptions = {}, { framework }) => {
27
28
  const filter = createFilter(options.include, options.exclude);
28
29
  const renderChunk = options.minify !== false ? (code, chunk) => {
29
30
  const result = minify(chunk.fileName, code, {
30
- ...options.minify,
31
+ ...options.minify === true ? {} : options.minify,
31
32
  sourcemap: options.sourcemap
32
33
  });
33
34
  return {
@@ -60,8 +61,12 @@ const Oxc = createUnplugin((rawOptions = {}, { framework }) => {
60
61
  builtinModules: true,
61
62
  ...options.resolve
62
63
  });
63
- const directory = path.dirname(importer || id);
64
+ const directory = importer ? path.dirname(importer) : process.cwd();
64
65
  const resolved = await resolver.async(directory, id);
66
+ if (resolved.error?.startsWith("Builtin module")) return {
67
+ id,
68
+ external: true
69
+ };
65
70
  if (resolved.path) return resolved.path;
66
71
  } : undefined,
67
72
  transformInclude(id) {
package/dist/unloader.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  //#region src/unloader.ts
4
4
  /**
package/dist/vite.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  //#region src/vite.ts
4
4
  /**
package/dist/webpack.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Oxc } from "./src-Ctwdi8QE.js";
1
+ import { Oxc } from "./src-ByY2eXwv.js";
2
2
 
3
3
  //#region src/webpack.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-oxc",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Oxc integration for unplugin.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -73,6 +73,7 @@
73
73
  "eslint": "^9.20.1",
74
74
  "prettier": "^3.5.0",
75
75
  "rollup": "^4.34.6",
76
+ "tinyexec": "^0.3.2",
76
77
  "tsdown": "^0.5.9",
77
78
  "tsx": "^4.19.2",
78
79
  "typescript": "^5.7.3",