vite-plugin-blocklet 0.5.17 → 0.5.18

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
@@ -1,4 +1,4 @@
1
- # vite-plugi-blocklet
1
+ # vite-plugin-blocklet
2
2
 
3
3
  The Vite library plugin, which enhanced development of [ArcBlock blocklet](http://developer.blocklet.io/)
4
4
 
package/dist/index.cjs CHANGED
@@ -162,7 +162,7 @@ async function setupClient(app, options = {}) {
162
162
  config: 'c',
163
163
  },
164
164
  });
165
- const { host = '127.0.0.1', protocol = 'ws', port: inputPort, configFile = '' } = options;
165
+ const { host = '127.0.0.1', protocol = 'ws', port: inputPort, configFile = '', appType = 'spa' } = options;
166
166
  const port = await getPort__default["default"]({ port: inputPort });
167
167
  // 以中间件模式创建 Vite 服务器
168
168
  const vite$1 = await vite.createServer({
@@ -175,9 +175,11 @@ async function setupClient(app, options = {}) {
175
175
  protocol,
176
176
  },
177
177
  },
178
+ appType,
178
179
  });
179
180
  // 将 vite 的 connect 实例作中间件使用
180
181
  app.use(vite$1.middlewares);
182
+ return vite$1;
181
183
  }
182
184
  }
183
185
 
package/libs/client.js CHANGED
@@ -12,7 +12,7 @@ export default async function setupClient(app, options = {}) {
12
12
  config: 'c',
13
13
  },
14
14
  });
15
- const { host = '127.0.0.1', protocol = 'ws', port: inputPort, configFile = '' } = options;
15
+ const { host = '127.0.0.1', protocol = 'ws', port: inputPort, configFile = '', appType = 'spa' } = options;
16
16
  const port = await getPort({ port: inputPort });
17
17
  // 以中间件模式创建 Vite 服务器
18
18
  const vite = await createServer({
@@ -25,8 +25,10 @@ export default async function setupClient(app, options = {}) {
25
25
  protocol,
26
26
  },
27
27
  },
28
+ appType,
28
29
  });
29
30
  // 将 vite 的 connect 实例作中间件使用
30
31
  app.use(vite.middlewares);
32
+ return vite;
31
33
  }
32
34
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-blocklet",
3
3
  "type": "module",
4
- "version": "0.5.17",
4
+ "version": "0.5.18",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "files": [