vite-plugin-blocklet 0.5.16 → 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 +3 -2
- package/dist/index.cjs +3 -1
- package/libs/client.js +3 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# vite-
|
|
1
|
+
# vite-plugin-blocklet
|
|
2
2
|
|
|
3
3
|
The Vite library plugin, which enhanced development of [ArcBlock blocklet](http://developer.blocklet.io/)
|
|
4
4
|
|
|
@@ -9,11 +9,12 @@ The Vite library plugin, which enhanced development of [ArcBlock blocklet](http:
|
|
|
9
9
|
import { defineConfig } from 'vite';
|
|
10
10
|
import react from '@vitejs/plugin-react';
|
|
11
11
|
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
12
|
+
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
|
12
13
|
|
|
13
14
|
// https://vitejs.dev/config/
|
|
14
15
|
export default defineConfig(async () => {
|
|
15
16
|
return {
|
|
16
|
-
plugins: [react(), createBlockletPlugin()],
|
|
17
|
+
plugins: [react(), createBlockletPlugin(), nodePolyfills({ protocolImports: true })],
|
|
17
18
|
};
|
|
18
19
|
});
|
|
19
20
|
```
|
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.
|
|
4
|
+
"version": "0.5.18",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"rollup": "^2.79.1"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@arcblock/did": "^1.18.
|
|
31
|
-
"@ocap/mcrypto": "^1.18.
|
|
32
|
-
"@ocap/util": "^1.18.
|
|
30
|
+
"@arcblock/did": "^1.18.50",
|
|
31
|
+
"@ocap/mcrypto": "^1.18.50",
|
|
32
|
+
"@ocap/util": "^1.18.50",
|
|
33
33
|
"get-port": "^5.1.1",
|
|
34
34
|
"mri": "^1.2.0",
|
|
35
35
|
"semver": "^7.3.8",
|