@multiplatform.one/vite-plugin-webext 6.6.0 → 6.7.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/lib/index.cjs CHANGED
@@ -31,6 +31,8 @@ node_fs = __toESM(node_fs, 1);
31
31
  let node_path = require("node:path");
32
32
  node_path = __toESM(node_path, 1);
33
33
  let _multiplatform_one_utils_dev = require("@multiplatform.one/utils/dev");
34
+ let _rolldown_plugin_babel = require("@rolldown/plugin-babel");
35
+ _rolldown_plugin_babel = __toESM(_rolldown_plugin_babel, 1);
34
36
  let _vitejs_plugin_react = require("@vitejs/plugin-react");
35
37
  _vitejs_plugin_react = __toESM(_vitejs_plugin_react, 1);
36
38
 
@@ -145,6 +147,7 @@ async function createWebextViewsConfig(options) {
145
147
  (0, _multiplatform_one_utils_dev.stubExpoTypeDeclarations)(),
146
148
  (0, _multiplatform_one_utils_dev.oneServerOnlyBrowserStub)(workspaceRoot),
147
149
  (0, _vitejs_plugin_react.default)({ jsxRuntime: "automatic" }),
150
+ (0, _rolldown_plugin_babel.default)({ presets: [(0, _vitejs_plugin_react.reactCompilerPreset)()] }),
148
151
  tamaguiPlugin({
149
152
  components: (0, _multiplatform_one_utils_dev.lookupTamaguiModules)([options.targetDir]),
150
153
  config: options.tamaguiConfig,
@@ -222,6 +225,8 @@ async function createWebextContentConfig(options) {
222
225
  (0, _multiplatform_one_utils_dev.stubExpoTypeDeclarations)(),
223
226
  (0, _multiplatform_one_utils_dev.oneServerOnlyBrowserStub)(workspaceRoot),
224
227
  shikiStubPlugin(),
228
+ (0, _vitejs_plugin_react.default)({ jsxRuntime: "automatic" }),
229
+ (0, _rolldown_plugin_babel.default)({ presets: [(0, _vitejs_plugin_react.reactCompilerPreset)()] }),
225
230
  tamaguiPlugin({
226
231
  components: (0, _multiplatform_one_utils_dev.lookupTamaguiModules)([options.targetDir]),
227
232
  config: options.tamaguiConfig,
package/lib/index.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { lookupProjectRoot, lookupTamaguiModules, oneServerOnlyBrowserStub, stubExpoTypeDeclarations, workspaceSourceAliases } from "@multiplatform.one/utils/dev";
4
- import react from "@vitejs/plugin-react";
4
+ import babel from "@rolldown/plugin-babel";
5
+ import react, { reactCompilerPreset } from "@vitejs/plugin-react";
5
6
 
6
7
  //#region src/index.ts
7
8
  const WEBEXT_EXTENSIONS = [
@@ -114,6 +115,7 @@ async function createWebextViewsConfig(options) {
114
115
  stubExpoTypeDeclarations(),
115
116
  oneServerOnlyBrowserStub(workspaceRoot),
116
117
  react({ jsxRuntime: "automatic" }),
118
+ babel({ presets: [reactCompilerPreset()] }),
117
119
  tamaguiPlugin({
118
120
  components: lookupTamaguiModules([options.targetDir]),
119
121
  config: options.tamaguiConfig,
@@ -191,6 +193,8 @@ async function createWebextContentConfig(options) {
191
193
  stubExpoTypeDeclarations(),
192
194
  oneServerOnlyBrowserStub(workspaceRoot),
193
195
  shikiStubPlugin(),
196
+ react({ jsxRuntime: "automatic" }),
197
+ babel({ presets: [reactCompilerPreset()] }),
194
198
  tamaguiPlugin({
195
199
  components: lookupTamaguiModules([options.targetDir]),
196
200
  config: options.tamaguiConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/vite-plugin-webext",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
4
4
  "description": "Vite config factories for building a browser web extension (MV3 views, background service worker, content scripts) as a target of a multiplatform.one One app — workspace source aliases, the one-server-only browser stub, Tamagui wiring, and the manifest/dev-reload prepare pipeline.",
5
5
  "keywords": [
6
6
  "browser-extension",
@@ -46,11 +46,15 @@
46
46
  "access": "public"
47
47
  },
48
48
  "dependencies": {
49
+ "@babel/core": "^7.26.0",
50
+ "@rolldown/plugin-babel": "^0.2.3",
51
+ "babel-plugin-react-compiler": "^1.0.0",
49
52
  "chokidar": "^5.0.0",
50
- "@multiplatform.one/utils": "6.6.0"
53
+ "@multiplatform.one/utils": "6.7.0"
51
54
  },
52
55
  "devDependencies": {
53
56
  "@tamagui/vite-plugin": "2.0.0-rc.41",
57
+ "@types/babel__core": "^7.20.5",
54
58
  "@types/node": "^25.6.0",
55
59
  "@vitejs/plugin-react": "^6.0.1",
56
60
  "typescript": "~5.9.3",
@@ -62,7 +66,7 @@
62
66
  "vite": ">=5"
63
67
  },
64
68
  "scripts": {
65
- "typecheck": "tsc --noEmit",
69
+ "typecheck": "tsgo --noEmit",
66
70
  "build": "rm -rf lib types 2>/dev/null && tsc -b --emitDeclarationOnly && tsdown"
67
71
  }
68
72
  }
package/src/index.ts CHANGED
@@ -25,7 +25,8 @@ import {
25
25
  workspaceSourceAliases,
26
26
  lookupProjectRoot,
27
27
  } from "@multiplatform.one/utils/dev";
28
- import react from "@vitejs/plugin-react";
28
+ import babel from "@rolldown/plugin-babel";
29
+ import react, { reactCompilerPreset } from "@vitejs/plugin-react";
29
30
  import type { Alias, Plugin, UserConfig } from "vite";
30
31
 
31
32
  export interface WebextPackageInfo {
@@ -169,6 +170,9 @@ export async function createWebextViewsConfig(options: WebextTargetOptions): Pro
169
170
  stubExpoTypeDeclarations(),
170
171
  oneServerOnlyBrowserStub(workspaceRoot),
171
172
  react({ jsxRuntime: "automatic" }),
173
+ // Same React Compiler pass the One app runs (react 19 built-in
174
+ // runtime) — extension views get the memoization for free.
175
+ babel({ presets: [reactCompilerPreset()] }),
172
176
  tamaguiPlugin({
173
177
  components: lookupTamaguiModules([options.targetDir]),
174
178
  config: options.tamaguiConfig,
@@ -258,6 +262,10 @@ export async function createWebextContentConfig(options: WebextTargetOptions): P
258
262
  stubExpoTypeDeclarations(),
259
263
  oneServerOnlyBrowserStub(workspaceRoot),
260
264
  shikiStubPlugin(),
265
+ // The react plugin transforms JSX (the esbuild jsx setting below
266
+ // stays for non-plugin paths); the babel pass adds the compiler.
267
+ react({ jsxRuntime: "automatic" }),
268
+ babel({ presets: [reactCompilerPreset()] }),
261
269
  tamaguiPlugin({
262
270
  components: lookupTamaguiModules([options.targetDir]),
263
271
  config: options.tamaguiConfig,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC;0CACsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB;2EACuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,aAAa,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,WAAW,EAAE,iBAAiB,CAAC;IAC/B,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;qCACiC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC;CACnB;AA4BD;;;iDAGiD;AACjD,wBAAgB,eAAe,IAAI,MAAM,CAYxC;AA6CD;2EAC2E;AAC3E,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAO3D;AAED,qEAAqE;AACrE,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CAoD/F;AAED;0CAC0C;AAC1C,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,mBAAmB,GAAG,UAAU,CA+BrF;AAED;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