@tomjs/vite-plugin-vscode 1.3.0 → 1.4.0
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 +1 -20
- package/README.zh_CN.md +1 -2
- package/env.d.ts +31 -0
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -87,8 +87,7 @@ private _getWebviewContent(webview: Webview, extensionUri: Uri) {
|
|
|
87
87
|
const nonce = uuid();
|
|
88
88
|
|
|
89
89
|
if (process.env.VITE_DEV_SERVER_URL) {
|
|
90
|
-
|
|
91
|
-
return __getWebviewHtml__({ serverUrl: process.env.VITE_DEV_SERVER_URL });
|
|
90
|
+
return __getWebviewHtml__(process.env.VITE_DEV_SERVER_URL);
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
// Tip: Install the es6-string-html VS Code extension to enable code highlighting below
|
|
@@ -140,15 +139,6 @@ export default defineConfig({
|
|
|
140
139
|
}),
|
|
141
140
|
vscode(),
|
|
142
141
|
],
|
|
143
|
-
build: {
|
|
144
|
-
rollupOptions: {
|
|
145
|
-
output: {
|
|
146
|
-
entryFileNames: `assets/[name].js`,
|
|
147
|
-
chunkFileNames: `assets/[name].js`,
|
|
148
|
-
assetFileNames: `assets/[name].[ext]`,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
142
|
});
|
|
153
143
|
```
|
|
154
144
|
|
|
@@ -164,15 +154,6 @@ import react from '@vitejs/plugin-react-swc';
|
|
|
164
154
|
// https://vitejs.dev/config/
|
|
165
155
|
export default defineConfig({
|
|
166
156
|
plugins: [react(), vscode()],
|
|
167
|
-
build: {
|
|
168
|
-
rollupOptions: {
|
|
169
|
-
output: {
|
|
170
|
-
entryFileNames: `assets/[name].js`,
|
|
171
|
-
chunkFileNames: `assets/[name].js`,
|
|
172
|
-
assetFileNames: `assets/[name].[ext]`,
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
157
|
});
|
|
177
158
|
```
|
|
178
159
|
|
package/README.zh_CN.md
CHANGED
|
@@ -87,8 +87,7 @@ private _getWebviewContent(webview: Webview, extensionUri: Uri) {
|
|
|
87
87
|
const nonce = uuid();
|
|
88
88
|
|
|
89
89
|
if (process.env.VITE_DEV_SERVER_URL) {
|
|
90
|
-
|
|
91
|
-
return __getWebviewHtml__({ serverUrl: process.env.VITE_DEV_SERVER_URL });
|
|
90
|
+
return __getWebviewHtml__(process.env.VITE_DEV_SERVER_URL);
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
// Tip: Install the es6-string-html VS Code extension to enable code highlighting below
|
package/env.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export {}; // Make this a module
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
/**
|
|
5
|
+
* fix code hint
|
|
6
|
+
*/
|
|
7
|
+
type UnionType<T> = T | (string & {});
|
|
8
|
+
|
|
9
|
+
namespace NodeJS {
|
|
10
|
+
interface ProcessEnv {
|
|
11
|
+
/**
|
|
12
|
+
* Node.js environment
|
|
13
|
+
*/
|
|
14
|
+
NODE_ENV: UnionType<'development' | 'production'>;
|
|
15
|
+
/**
|
|
16
|
+
* `[vite serve]` The url of the vite dev server.
|
|
17
|
+
*/
|
|
18
|
+
VITE_DEV_SERVER_URL?: string;
|
|
19
|
+
/**
|
|
20
|
+
* `[vite build]` All js files in the dist directory, excluding index.js. It's to be a json string.
|
|
21
|
+
*/
|
|
22
|
+
VITE_DIST_FILES?: string;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* `[vite serve]` Get the html of the development webview.
|
|
28
|
+
* @param options serverUrl: The url of the vite dev server.
|
|
29
|
+
*/
|
|
30
|
+
function __getWebviewHtml__(options?: string | { serverUrl: string }): string;
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/vite-plugin-vscode",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "The vite plugin for vscode extension, supports esm and cjs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
|
-
"dist"
|
|
30
|
+
"dist",
|
|
31
|
+
"env.d.ts"
|
|
31
32
|
],
|
|
32
33
|
"engines": {
|
|
33
34
|
"node": ">=16"
|
|
@@ -49,22 +50,22 @@
|
|
|
49
50
|
"tsup": "7.2.0"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@commitlint/cli": "^18.4.
|
|
53
|
-
"@tomjs/commitlint": "^2.1.
|
|
54
|
-
"@tomjs/eslint": "^1.2.
|
|
53
|
+
"@commitlint/cli": "^18.4.4",
|
|
54
|
+
"@tomjs/commitlint": "^2.1.2",
|
|
55
|
+
"@tomjs/eslint": "^1.2.2",
|
|
55
56
|
"@tomjs/prettier": "^1.1.1",
|
|
56
|
-
"@tomjs/stylelint": "^2.
|
|
57
|
-
"@tomjs/tsconfig": "^1.
|
|
57
|
+
"@tomjs/stylelint": "^2.2.0",
|
|
58
|
+
"@tomjs/tsconfig": "^1.3.0",
|
|
58
59
|
"@types/lodash.clonedeep": "^4.5.9",
|
|
59
60
|
"@types/lodash.merge": "^4.6.9",
|
|
60
|
-
"@types/node": "^18.19.
|
|
61
|
+
"@types/node": "^18.19.7",
|
|
61
62
|
"cross-env": "^7.0.3",
|
|
62
63
|
"eslint": "^8.56.0",
|
|
63
64
|
"husky": "^8.0.3",
|
|
64
65
|
"lint-staged": "^15.2.0",
|
|
65
66
|
"np": "^9.2.0",
|
|
66
67
|
"npm-run-all": "^4.1.5",
|
|
67
|
-
"prettier": "^3.
|
|
68
|
+
"prettier": "^3.2.2",
|
|
68
69
|
"rimraf": "^5.0.5",
|
|
69
70
|
"stylelint": "^16.1.0",
|
|
70
71
|
"tsx": "^4.7.0",
|