ms-vite-plugin 0.2.0 → 0.2.1

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 +4 -9
  2. package/package.json +1 -1
package/dist/build.js CHANGED
@@ -77,13 +77,11 @@ async function findEntryFiles(src, baseDir) {
77
77
  function returnMain() {
78
78
  return {
79
79
  name: "return-main",
80
- generateBundle(_, bundle) {
81
- for (const fileName in bundle) {
82
- const chunk = bundle[fileName];
83
- if (chunk.type === "chunk") {
84
- chunk.code = chunk.code.replace(/\bmain\s*\(\s*\)\s*;/g, "return main();");
85
- }
80
+ renderChunk(code, chunk) {
81
+ if (chunk.isEntry) {
82
+ return code.replace(/\bmain\s*\(\s*\)\s*;/g, "return main();");
86
83
  }
84
+ return code;
87
85
  },
88
86
  };
89
87
  }
@@ -110,9 +108,6 @@ const buildAll = async (isDev = true, workspacePath) => {
110
108
  sourcemap: isDev,
111
109
  minify: !isDev, // 开发环境不压缩变量名
112
110
  },
113
- esbuild: {
114
- keepNames: true,
115
- },
116
111
  plugins: isDev
117
112
  ? [returnMain()]
118
113
  : [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {