@vizejs/unplugin 0.715.0 → 0.717.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/README.md +19 -0
- package/dist/babel.cjs +1 -1
- package/dist/babel.mjs +1 -1
- package/dist/bun.cjs +4 -0
- package/dist/bun.d.cts +6 -0
- package/dist/bun.d.mts +7 -0
- package/dist/bun.mjs +5 -0
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/rolldown.cjs +1 -1
- package/dist/rolldown.mjs +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.mjs +1 -1
- package/dist/{unplugin-GPIK1JbA.mjs → unplugin-BoI0KB8a.mjs} +18 -0
- package/dist/{unplugin-DDPt-Soc.cjs → unplugin-CpH93S1g.cjs} +18 -0
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ Experimental unplugin-based Vue SFC integration powered by [Vize](https://github
|
|
|
12
12
|
- `rolldown`
|
|
13
13
|
- `webpack`
|
|
14
14
|
- `esbuild`
|
|
15
|
+
- `bun`
|
|
15
16
|
- `babel`
|
|
16
17
|
|
|
17
18
|
Rspack intentionally uses the dedicated `@vizejs/rspack-plugin` path instead of an `unplugin` export because its loader chain, `experiments.css`, and HMR behavior need Rspack-specific handling.
|
|
@@ -112,6 +113,24 @@ export default {
|
|
|
112
113
|
The Babel adapter compiles `.vue` files before Babel parses them. Keep your usual Babel
|
|
113
114
|
TypeScript/JSX transforms in the pipeline if your SFC scripts use those syntaxes.
|
|
114
115
|
|
|
116
|
+
### Bun
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import vize from "@vizejs/unplugin/bun";
|
|
120
|
+
|
|
121
|
+
const result = await Bun.build({
|
|
122
|
+
entrypoints: ["src/main.ts"],
|
|
123
|
+
outdir: "dist",
|
|
124
|
+
plugins: [vize()],
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
if (!result.success) throw new AggregateError(result.logs);
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The Bun adapter compiles imported `.vue`, `.jsx`, and `.tsx` modules. Bun emits
|
|
131
|
+
plain and scoped SFC styles through its CSS bundle; install the matching Sass,
|
|
132
|
+
Less, or Stylus package when an SFC selects that preprocessor.
|
|
133
|
+
|
|
115
134
|
## Caveats
|
|
116
135
|
|
|
117
136
|
- Vite is still the recommended integration if you need the most complete behavior today.
|
package/dist/babel.cjs
CHANGED
package/dist/babel.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createFilter, i as generateOutput, r as compileVueModule, t as normalizeOptions } from "./unplugin-
|
|
1
|
+
import { a as createFilter, i as generateOutput, r as compileVueModule, t as normalizeOptions } from "./unplugin-BoI0KB8a.mjs";
|
|
2
2
|
//#region src/babel.ts
|
|
3
3
|
function vizeBabelPlugin(_api, rawOptions = {}) {
|
|
4
4
|
const options = normalizeOptions(rawOptions);
|
package/dist/bun.cjs
ADDED
package/dist/bun.d.cts
ADDED
package/dist/bun.d.mts
ADDED
package/dist/bun.mjs
ADDED
package/dist/esbuild.cjs
CHANGED
package/dist/esbuild.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_unplugin = require("./unplugin-
|
|
5
|
+
const require_unplugin = require("./unplugin-CpH93S1g.cjs");
|
|
6
6
|
exports.default = require_unplugin.vizeUnplugin;
|
|
7
7
|
exports.vizeUnplugin = require_unplugin.vizeUnplugin;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as vizeUnplugin } from "./unplugin-
|
|
1
|
+
import { n as vizeUnplugin } from "./unplugin-BoI0KB8a.mjs";
|
|
2
2
|
export { vizeUnplugin as default, vizeUnplugin };
|
package/dist/rolldown.cjs
CHANGED
package/dist/rolldown.mjs
CHANGED
package/dist/rollup.cjs
CHANGED
package/dist/rollup.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { c as scopeCss, i as webpackStyleRequest, l as transformStyleVars, n as registerWebpackStyleRule, o as isPreprocessorLang, r as webpackStylePath, s as preprocessStyle, t as findVirtualModules } from "./webpack-styles-CfS46MAj.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
3
4
|
import { createUnplugin } from "unplugin";
|
|
4
5
|
import { createHash } from "node:crypto";
|
|
5
6
|
import * as native from "@vizejs/native";
|
|
@@ -606,6 +607,7 @@ function compileJsxModule(filePath, source, options, output) {
|
|
|
606
607
|
* never follows an import, and its CSS loaders compile no preprocessor.
|
|
607
608
|
*/
|
|
608
609
|
function hostCss(context, framework) {
|
|
610
|
+
if (framework === "bun") return "css";
|
|
609
611
|
if (framework !== "esbuild") return "preprocessors";
|
|
610
612
|
return (context.getNativeBuildContext?.())?.build?.initialOptions?.bundle === true ? "css" : "none";
|
|
611
613
|
}
|
|
@@ -800,6 +802,10 @@ const vizeUnplugin = createUnplugin((rawOptions = {}, meta) => {
|
|
|
800
802
|
},
|
|
801
803
|
async load(id) {
|
|
802
804
|
if (options.hostCompiler) return null;
|
|
805
|
+
if (meta.framework === "bun" && isVueFile(id)) return {
|
|
806
|
+
code: await readFile(id, "utf8"),
|
|
807
|
+
map: null
|
|
808
|
+
};
|
|
803
809
|
if (!isVueStyleRequest(id)) return null;
|
|
804
810
|
loadedStyles = true;
|
|
805
811
|
return {
|
|
@@ -873,6 +879,18 @@ const vizeUnplugin = createUnplugin((rawOptions = {}, meta) => {
|
|
|
873
879
|
...buildOptions.define
|
|
874
880
|
};
|
|
875
881
|
}
|
|
882
|
+
},
|
|
883
|
+
bun: {
|
|
884
|
+
loader(_code, id) {
|
|
885
|
+
return isVueStyleRequest(id) ? "css" : "js";
|
|
886
|
+
},
|
|
887
|
+
setup(build) {
|
|
888
|
+
if (options.hostCompiler) return;
|
|
889
|
+
build.config.define = {
|
|
890
|
+
...createVueDefineMap(options.isProduction),
|
|
891
|
+
...build.config.define
|
|
892
|
+
};
|
|
893
|
+
}
|
|
876
894
|
}
|
|
877
895
|
};
|
|
878
896
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_webpack_styles = require("./webpack-styles-CN45pz-Y.cjs");
|
|
2
2
|
let node_module = require("node:module");
|
|
3
|
+
let node_fs_promises = require("node:fs/promises");
|
|
3
4
|
let unplugin = require("unplugin");
|
|
4
5
|
let node_crypto = require("node:crypto");
|
|
5
6
|
let _vizejs_native = require("@vizejs/native");
|
|
@@ -608,6 +609,7 @@ function compileJsxModule(filePath, source, options, output) {
|
|
|
608
609
|
* never follows an import, and its CSS loaders compile no preprocessor.
|
|
609
610
|
*/
|
|
610
611
|
function hostCss(context, framework) {
|
|
612
|
+
if (framework === "bun") return "css";
|
|
611
613
|
if (framework !== "esbuild") return "preprocessors";
|
|
612
614
|
return (context.getNativeBuildContext?.())?.build?.initialOptions?.bundle === true ? "css" : "none";
|
|
613
615
|
}
|
|
@@ -802,6 +804,10 @@ const vizeUnplugin = (0, unplugin.createUnplugin)((rawOptions = {}, meta) => {
|
|
|
802
804
|
},
|
|
803
805
|
async load(id) {
|
|
804
806
|
if (options.hostCompiler) return null;
|
|
807
|
+
if (meta.framework === "bun" && isVueFile(id)) return {
|
|
808
|
+
code: await (0, node_fs_promises.readFile)(id, "utf8"),
|
|
809
|
+
map: null
|
|
810
|
+
};
|
|
805
811
|
if (!isVueStyleRequest(id)) return null;
|
|
806
812
|
loadedStyles = true;
|
|
807
813
|
return {
|
|
@@ -875,6 +881,18 @@ const vizeUnplugin = (0, unplugin.createUnplugin)((rawOptions = {}, meta) => {
|
|
|
875
881
|
...buildOptions.define
|
|
876
882
|
};
|
|
877
883
|
}
|
|
884
|
+
},
|
|
885
|
+
bun: {
|
|
886
|
+
loader(_code, id) {
|
|
887
|
+
return isVueStyleRequest(id) ? "css" : "js";
|
|
888
|
+
},
|
|
889
|
+
setup(build) {
|
|
890
|
+
if (options.hostCompiler) return;
|
|
891
|
+
build.config.define = {
|
|
892
|
+
...createVueDefineMap(options.isProduction),
|
|
893
|
+
...build.config.define
|
|
894
|
+
};
|
|
895
|
+
}
|
|
878
896
|
}
|
|
879
897
|
};
|
|
880
898
|
});
|
package/dist/webpack.cjs
CHANGED
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/unplugin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Experimental Vue SFC integrations for Rollup, Rolldown, Webpack, esbuild, and Babel powered by Vize",
|
|
3
|
+
"version": "0.717.0",
|
|
4
|
+
"description": "Experimental Vue SFC integrations for Rollup, Rolldown, Webpack, esbuild, Bun, and Babel powered by Vize",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babel",
|
|
7
|
+
"bun",
|
|
7
8
|
"compiler",
|
|
8
9
|
"esbuild",
|
|
9
10
|
"fast",
|
|
@@ -42,6 +43,11 @@
|
|
|
42
43
|
"import": "./dist/esbuild.mjs",
|
|
43
44
|
"default": "./dist/esbuild.mjs"
|
|
44
45
|
},
|
|
46
|
+
"./bun": {
|
|
47
|
+
"types": "./dist/bun.d.mts",
|
|
48
|
+
"import": "./dist/bun.mjs",
|
|
49
|
+
"default": "./dist/bun.mjs"
|
|
50
|
+
},
|
|
45
51
|
"./rollup": {
|
|
46
52
|
"types": "./dist/rollup.d.mts",
|
|
47
53
|
"import": "./dist/rollup.mjs",
|
|
@@ -68,7 +74,7 @@
|
|
|
68
74
|
"access": "public"
|
|
69
75
|
},
|
|
70
76
|
"dependencies": {
|
|
71
|
-
"@vizejs/native": "0.
|
|
77
|
+
"@vizejs/native": "0.717.0",
|
|
72
78
|
"oxc-transform": "0.144.0",
|
|
73
79
|
"unplugin": "3.3.0"
|
|
74
80
|
},
|