@vizejs/unplugin 0.714.0 → 0.716.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 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
@@ -1,4 +1,4 @@
1
- const require_unplugin = require("./unplugin-DDPt-Soc.cjs");
1
+ const require_unplugin = require("./unplugin-CpH93S1g.cjs");
2
2
  //#region src/babel.ts
3
3
  function vizeBabelPlugin(_api, rawOptions = {}) {
4
4
  const options = require_unplugin.normalizeOptions(rawOptions);
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-GPIK1JbA.mjs";
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
@@ -0,0 +1,4 @@
1
+ //#region src/bun.ts
2
+ const vizeBunPlugin = require("./unplugin-CpH93S1g.cjs").vizeUnplugin.bun;
3
+ //#endregion
4
+ module.exports = vizeBunPlugin;
package/dist/bun.d.cts ADDED
@@ -0,0 +1,6 @@
1
+ import { r as VizeUnpluginOptions } from "./types-DGWIbaKi.cjs";
2
+ import { BunPlugin } from "unplugin";
3
+
4
+ //#region src/bun.d.ts
5
+ declare const vizeBunPlugin: (options?: VizeUnpluginOptions) => BunPlugin;
6
+ export = vizeBunPlugin;
package/dist/bun.d.mts ADDED
@@ -0,0 +1,7 @@
1
+ import { r as VizeUnpluginOptions } from "./types-DGWIbaKi.mjs";
2
+ import { BunPlugin } from "unplugin";
3
+
4
+ //#region src/bun.d.ts
5
+ declare const vizeBunPlugin: (options?: VizeUnpluginOptions) => BunPlugin;
6
+ //#endregion
7
+ export { vizeBunPlugin as default };
package/dist/bun.mjs ADDED
@@ -0,0 +1,5 @@
1
+ import { n as vizeUnplugin } from "./unplugin-BoI0KB8a.mjs";
2
+ //#region src/bun.ts
3
+ const vizeBunPlugin = vizeUnplugin.bun;
4
+ //#endregion
5
+ export { vizeBunPlugin as default };
package/dist/esbuild.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region src/esbuild.ts
2
- var esbuild_default = require("./unplugin-DDPt-Soc.cjs").vizeUnplugin.esbuild;
2
+ var esbuild_default = require("./unplugin-CpH93S1g.cjs").vizeUnplugin.esbuild;
3
3
  //#endregion
4
4
  module.exports = esbuild_default;
package/dist/esbuild.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as vizeUnplugin } from "./unplugin-GPIK1JbA.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-BoI0KB8a.mjs";
2
2
  //#region src/esbuild.ts
3
3
  var esbuild_default = vizeUnplugin.esbuild;
4
4
  //#endregion
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-DDPt-Soc.cjs");
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-GPIK1JbA.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-BoI0KB8a.mjs";
2
2
  export { vizeUnplugin as default, vizeUnplugin };
package/dist/rolldown.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region src/rolldown.ts
2
- var rolldown_default = require("./unplugin-DDPt-Soc.cjs").vizeUnplugin.rollup;
2
+ var rolldown_default = require("./unplugin-CpH93S1g.cjs").vizeUnplugin.rollup;
3
3
  //#endregion
4
4
  module.exports = rolldown_default;
package/dist/rolldown.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as vizeUnplugin } from "./unplugin-GPIK1JbA.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-BoI0KB8a.mjs";
2
2
  //#region src/rolldown.ts
3
3
  var rolldown_default = vizeUnplugin.rollup;
4
4
  //#endregion
package/dist/rollup.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region src/rollup.ts
2
- var rollup_default = require("./unplugin-DDPt-Soc.cjs").vizeUnplugin.rollup;
2
+ var rollup_default = require("./unplugin-CpH93S1g.cjs").vizeUnplugin.rollup;
3
3
  //#endregion
4
4
  module.exports = rollup_default;
package/dist/rollup.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as vizeUnplugin } from "./unplugin-GPIK1JbA.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-BoI0KB8a.mjs";
2
2
  //#region src/rollup.ts
3
3
  var rollup_default = vizeUnplugin.rollup;
4
4
  //#endregion
@@ -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
@@ -1,4 +1,4 @@
1
1
  //#region src/webpack.ts
2
- var webpack_default = require("./unplugin-DDPt-Soc.cjs").vizeUnplugin.webpack;
2
+ var webpack_default = require("./unplugin-CpH93S1g.cjs").vizeUnplugin.webpack;
3
3
  //#endregion
4
4
  module.exports = webpack_default;
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as vizeUnplugin } from "./unplugin-GPIK1JbA.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-BoI0KB8a.mjs";
2
2
  //#region src/webpack.ts
3
3
  var webpack_default = vizeUnplugin.webpack;
4
4
  //#endregion
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@vizejs/unplugin",
3
- "version": "0.714.0",
4
- "description": "Experimental Vue SFC integrations for Rollup, Rolldown, Webpack, esbuild, and Babel powered by Vize",
3
+ "version": "0.716.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.714.0",
77
+ "@vizejs/native": "0.716.0",
72
78
  "oxc-transform": "0.144.0",
73
79
  "unplugin": "3.3.0"
74
80
  },