unplugin-oxc 0.5.1 → 0.5.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.
- package/dist/api.d.ts +1 -1
- package/dist/esbuild.js +3 -2
- package/dist/farm.js +3 -2
- package/dist/index.js +1 -1
- package/dist/rolldown.js +3 -2
- package/dist/rollup.js +3 -2
- package/dist/rspack.js +3 -2
- package/dist/{src-pBkchcHA.js → src-zdyCluyM.js} +24 -27
- package/dist/unloader.js +3 -2
- package/dist/vite.js +3 -2
- package/dist/webpack.js +3 -2
- package/package.json +13 -13
package/dist/api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { };
|
package/dist/esbuild.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Oxc } from "./src-
|
|
1
|
+
import { Oxc } from "./src-zdyCluyM.js";
|
|
2
2
|
|
|
3
3
|
//#region src/esbuild.ts
|
|
4
4
|
/**
|
|
@@ -13,6 +13,7 @@ import { Oxc } from "./src-pBkchcHA.js";
|
|
|
13
13
|
```
|
|
14
14
|
*/
|
|
15
15
|
const esbuild = Oxc.esbuild;
|
|
16
|
+
var esbuild_default = esbuild;
|
|
16
17
|
|
|
17
18
|
//#endregion
|
|
18
|
-
export {
|
|
19
|
+
export { esbuild_default as default, esbuild as "module.exports" };
|
package/dist/farm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Oxc } from "./src-
|
|
1
|
+
import { Oxc } from "./src-zdyCluyM.js";
|
|
2
2
|
|
|
3
3
|
//#region src/farm.ts
|
|
4
4
|
/**
|
|
@@ -15,6 +15,7 @@ import { Oxc } from "./src-pBkchcHA.js";
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
const farm = Oxc.farm;
|
|
18
|
+
var farm_default = farm;
|
|
18
19
|
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { farm_default as default, farm as "module.exports" };
|
package/dist/index.js
CHANGED
package/dist/rolldown.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Oxc } from "./src-
|
|
1
|
+
import { Oxc } from "./src-zdyCluyM.js";
|
|
2
2
|
|
|
3
3
|
//#region src/rolldown.ts
|
|
4
4
|
/**
|
|
@@ -15,6 +15,7 @@ import { Oxc } from "./src-pBkchcHA.js";
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
const rolldown = Oxc.rolldown;
|
|
18
|
+
var rolldown_default = rolldown;
|
|
18
19
|
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { rolldown_default as default, rolldown as "module.exports" };
|
package/dist/rollup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Oxc } from "./src-
|
|
1
|
+
import { Oxc } from "./src-zdyCluyM.js";
|
|
2
2
|
|
|
3
3
|
//#region src/rollup.ts
|
|
4
4
|
/**
|
|
@@ -15,6 +15,7 @@ import { Oxc } from "./src-pBkchcHA.js";
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
const rollup = Oxc.rollup;
|
|
18
|
+
var rollup_default = rollup;
|
|
18
19
|
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { rollup_default as default, rollup as "module.exports" };
|
package/dist/rspack.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Oxc } from "./src-
|
|
1
|
+
import { Oxc } from "./src-zdyCluyM.js";
|
|
2
2
|
|
|
3
3
|
//#region src/rspack.ts
|
|
4
4
|
/**
|
|
@@ -15,6 +15,7 @@ import { Oxc } from "./src-pBkchcHA.js";
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
const rspack = Oxc.rspack;
|
|
18
|
+
var rspack_default = rspack;
|
|
18
19
|
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { rspack_default as default, rspack as "module.exports" };
|
|
@@ -23,8 +23,7 @@ function resolveOptions(options, framework) {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/core/utils.ts
|
|
25
25
|
function getModuleFormat(id) {
|
|
26
|
-
|
|
27
|
-
switch (ext) {
|
|
26
|
+
switch (path.extname(id)) {
|
|
28
27
|
case ".mjs":
|
|
29
28
|
case ".mts": return "module";
|
|
30
29
|
case ".cjs":
|
|
@@ -102,30 +101,6 @@ const Oxc = createUnplugin((rawOptions = {}, { framework }) => {
|
|
|
102
101
|
map: result.map
|
|
103
102
|
};
|
|
104
103
|
} : void 0;
|
|
105
|
-
const unloader = {
|
|
106
|
-
options(config) {
|
|
107
|
-
config.sourcemap ||= options.sourcemap;
|
|
108
|
-
},
|
|
109
|
-
load(id) {
|
|
110
|
-
if (id.endsWith(".json")) {
|
|
111
|
-
let code = readFileSync(id, "utf8");
|
|
112
|
-
const json = JSON.parse(code);
|
|
113
|
-
code = `const json = ${code}\nexport default json\n`;
|
|
114
|
-
const i = 0;
|
|
115
|
-
for (const key of Object.keys(json)) {
|
|
116
|
-
const sanitizedKey = `_${key.replaceAll(/\W/g, "_")}${i}`;
|
|
117
|
-
code += `\nconst ${sanitizedKey} = json[${JSON.stringify(key)}]\nexport { ${sanitizedKey} as ${JSON.stringify(key)} }\n`;
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
code,
|
|
121
|
-
format: "module"
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
if (!filter(id)) return;
|
|
125
|
-
const contents = readFileSync(id, "utf8");
|
|
126
|
-
return contents;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
104
|
return {
|
|
130
105
|
name: "unplugin-oxc",
|
|
131
106
|
enforce: options.enforce,
|
|
@@ -137,7 +112,29 @@ const Oxc = createUnplugin((rawOptions = {}, { framework }) => {
|
|
|
137
112
|
rollup: { renderChunk },
|
|
138
113
|
rolldown: { renderChunk },
|
|
139
114
|
vite: { renderChunk },
|
|
140
|
-
unloader
|
|
115
|
+
unloader: {
|
|
116
|
+
options(config) {
|
|
117
|
+
config.sourcemap ||= options.sourcemap;
|
|
118
|
+
},
|
|
119
|
+
load(id) {
|
|
120
|
+
if (id.endsWith(".json")) {
|
|
121
|
+
let code = readFileSync(id, "utf8");
|
|
122
|
+
const json = JSON.parse(code);
|
|
123
|
+
code = `const json = ${code}\nexport default json\n`;
|
|
124
|
+
const i = 0;
|
|
125
|
+
for (const key of Object.keys(json)) {
|
|
126
|
+
const sanitizedKey = `_${key.replaceAll(/\W/g, "_")}${i}`;
|
|
127
|
+
code += `\nconst ${sanitizedKey} = json[${JSON.stringify(key)}]\nexport { ${sanitizedKey} as ${JSON.stringify(key)} }\n`;
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
code,
|
|
131
|
+
format: "module"
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (!filter(id)) return;
|
|
135
|
+
return readFileSync(id, "utf8");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
141
138
|
};
|
|
142
139
|
});
|
|
143
140
|
function guessSourceType(id, format) {
|
package/dist/unloader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Oxc } from "./src-
|
|
1
|
+
import { Oxc } from "./src-zdyCluyM.js";
|
|
2
2
|
|
|
3
3
|
//#region src/unloader.ts
|
|
4
4
|
/**
|
|
@@ -15,6 +15,7 @@ import { Oxc } from "./src-pBkchcHA.js";
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
const unloader = Oxc.unloader;
|
|
18
|
+
var unloader_default = unloader;
|
|
18
19
|
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { unloader_default as default, unloader as "module.exports" };
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Oxc } from "./src-
|
|
1
|
+
import { Oxc } from "./src-zdyCluyM.js";
|
|
2
2
|
|
|
3
3
|
//#region src/vite.ts
|
|
4
4
|
/**
|
|
@@ -15,6 +15,7 @@ import { Oxc } from "./src-pBkchcHA.js";
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
const vite = Oxc.vite;
|
|
18
|
+
var vite_default = vite;
|
|
18
19
|
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { vite_default as default, vite as "module.exports" };
|
package/dist/webpack.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Oxc } from "./src-
|
|
1
|
+
import { Oxc } from "./src-zdyCluyM.js";
|
|
2
2
|
|
|
3
3
|
//#region src/webpack.ts
|
|
4
4
|
/**
|
|
@@ -15,6 +15,7 @@ import { Oxc } from "./src-pBkchcHA.js";
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
const webpack = Oxc.webpack;
|
|
18
|
+
var webpack_default = webpack;
|
|
18
19
|
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { webpack_default as default, webpack as "module.exports" };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-oxc",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Oxc integration for unplugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -63,27 +63,27 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"oxc-minify": ">=0.
|
|
67
|
-
"oxc-resolver": "^11.
|
|
68
|
-
"oxc-transform": ">=0.
|
|
69
|
-
"unplugin": "^2.3.
|
|
70
|
-
"unplugin-utils": "^0.
|
|
66
|
+
"oxc-minify": ">=0.89.0",
|
|
67
|
+
"oxc-resolver": "^11.8.0",
|
|
68
|
+
"oxc-transform": ">=0.89.0",
|
|
69
|
+
"unplugin": "^2.3.10",
|
|
70
|
+
"unplugin-utils": "^0.3.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@sxzz/eslint-config": "^7.1.4",
|
|
74
74
|
"@sxzz/prettier-config": "^2.2.4",
|
|
75
|
-
"@sxzz/test-utils": "^0.5.
|
|
76
|
-
"@types/node": "^24.
|
|
75
|
+
"@sxzz/test-utils": "^0.5.11",
|
|
76
|
+
"@types/node": "^24.5.0",
|
|
77
77
|
"bumpp": "^10.2.3",
|
|
78
|
-
"eslint": "^9.
|
|
78
|
+
"eslint": "^9.35.0",
|
|
79
79
|
"prettier": "^3.6.2",
|
|
80
|
-
"rollup": "^4.
|
|
80
|
+
"rollup": "^4.50.2",
|
|
81
81
|
"tinyexec": "^1.0.1",
|
|
82
|
-
"tsdown": "^0.
|
|
83
|
-
"tsx": "^4.20.
|
|
82
|
+
"tsdown": "^0.15.1",
|
|
83
|
+
"tsx": "^4.20.5",
|
|
84
84
|
"typescript": "^5.9.2",
|
|
85
85
|
"unloader": "^0.5.0",
|
|
86
|
-
"vite": "^7.1.
|
|
86
|
+
"vite": "^7.1.5",
|
|
87
87
|
"vitest": "^3.2.4"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|