miaoda-expo-devkit 0.1.1-beta.59 → 0.1.1-beta.60

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.
@@ -35,17 +35,25 @@ __export(preset_exports, {
35
35
  module.exports = __toCommonJS(preset_exports);
36
36
  function presetExpoDevkit(api, options = {}) {
37
37
  const isDev = api.env("development");
38
+ const isWeb = api.caller((caller) => caller?.platform === "web");
38
39
  const { rootDir = process.cwd(), excludePaths = [], lucide = {} } = options;
40
+ const workletsPlugin = require.resolve("react-native-worklets/plugin");
39
41
  return {
40
42
  presets: [
41
- ["babel-preset-expo", { jsxImportSource: "nativewind" }],
43
+ ["babel-preset-expo", {
44
+ jsxImportSource: "nativewind",
45
+ // web 上禁止自动注入,避免下方手动注入后跑两遍
46
+ ...isWeb && { worklets: false }
47
+ }],
42
48
  "nativewind/babel"
43
49
  ],
44
50
  plugins: [
45
51
  // lucide tree-shaking:所有环境都需要,Metro 不具备 tree-shaking 能力
46
52
  ...lucide !== false ? [[require.resolve("./plugin-lucide-react-native"), lucide]] : [],
47
53
  // jsx-source 仅开发环境注入,生产无需调试元数据
48
- ...isDev ? [[require.resolve("./plugin-jsx-source"), { rootDir, excludePaths }]] : []
54
+ ...isDev ? [[require.resolve("./plugin-jsx-source"), { rootDir, excludePaths }]] : [],
55
+ // web 平台手动注入 worklets plugin,跳过 native 专属数据
56
+ ...isWeb ? [[workletsPlugin, { omitNativeOnlyData: true, substituteWebPlatformChecks: true }]] : []
49
57
  ]
50
58
  };
51
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miaoda-expo-devkit",
3
- "version": "0.1.1-beta.59",
3
+ "version": "0.1.1-beta.60",
4
4
  "description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",