ms-vite-plugin 0.0.12 → 0.0.13

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.
Files changed (2) hide show
  1. package/dist/build.js +6 -0
  2. package/package.json +1 -1
package/dist/build.js CHANGED
@@ -84,11 +84,17 @@ const buildAll = async (isDev = true, workspacePath) => {
84
84
  [path.basename(entry, path.extname(entry))]: `./scripts/${entry}`,
85
85
  },
86
86
  formats: ["iife"],
87
+ name: "MagicScript", // IIFE 格式必需的全局变量名
87
88
  },
88
89
  outDir: "msbundle/scripts",
89
90
  emptyOutDir: false, // 不要每次清空输出目录
90
91
  sourcemap: isDev,
91
92
  minify: !isDev, // 开发环境不压缩变量名
93
+ rollupOptions: {
94
+ output: {
95
+ format: "iife", // 使用立即执行函数表达式,避免exports问题
96
+ },
97
+ },
92
98
  },
93
99
  plugins: isDev
94
100
  ? []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {