@lark-apaas/fullstack-vite-preset 1.0.1-beta.2 → 1.0.1-beta.21
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/lib/module-alias/echarts-for-react.d.ts +1 -8
- package/lib/module-alias/echarts-for-react.d.ts.map +1 -1
- package/lib/module-alias/echarts-for-react.js +45 -11
- package/lib/module-alias/echarts-for-react.js.map +1 -1
- package/lib/module-alias/echarts.d.ts +4 -0
- package/lib/module-alias/echarts.d.ts.map +1 -1
- package/lib/module-alias/echarts.js +17 -2
- package/lib/module-alias/echarts.js.map +1 -1
- package/lib/module-alias/registry_echarts_theme.d.ts +2 -6
- package/lib/module-alias/registry_echarts_theme.d.ts.map +1 -1
- package/lib/module-alias/registry_echarts_theme.js +1 -1
- package/lib/module-alias/registry_echarts_theme.js.map +1 -1
- package/lib/polyfills/index.d.ts +15 -0
- package/lib/polyfills/index.d.ts.map +1 -0
- package/lib/polyfills/index.js +36 -0
- package/lib/polyfills/index.js.map +1 -0
- package/lib/preset.d.ts.map +1 -1
- package/lib/preset.js +44 -12
- package/lib/preset.js.map +1 -1
- package/lib/vite-plugins/css-legacy-plugin.d.ts +12 -0
- package/lib/vite-plugins/css-legacy-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/css-legacy-plugin.js +205 -0
- package/lib/vite-plugins/css-legacy-plugin.js.map +1 -0
- package/lib/vite-plugins/html-output-plugin.d.ts +7 -0
- package/lib/vite-plugins/html-output-plugin.d.ts.map +1 -1
- package/lib/vite-plugins/html-output-plugin.js +49 -7
- package/lib/vite-plugins/html-output-plugin.js.map +1 -1
- package/lib/vite-plugins/module-alias-plugin.d.ts.map +1 -1
- package/lib/vite-plugins/module-alias-plugin.js +4 -0
- package/lib/vite-plugins/module-alias-plugin.js.map +1 -1
- package/lib/vite-plugins/polyfill-plugin.d.ts +12 -0
- package/lib/vite-plugins/polyfill-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/polyfill-plugin.js +120 -0
- package/lib/vite-plugins/polyfill-plugin.js.map +1 -0
- package/lib/vite-plugins/route-parser-plugin.d.ts +3 -1
- package/lib/vite-plugins/route-parser-plugin.d.ts.map +1 -1
- package/lib/vite-plugins/route-parser-plugin.js +47 -18
- package/lib/vite-plugins/route-parser-plugin.js.map +1 -1
- package/lib/vite-plugins/static-assets-plugin.d.ts +27 -0
- package/lib/vite-plugins/static-assets-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/static-assets-plugin.js +393 -0
- package/lib/vite-plugins/static-assets-plugin.js.map +1 -0
- package/lib/vite-plugins/vite-client-patch-plugin.d.ts +23 -0
- package/lib/vite-plugins/vite-client-patch-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/vite-client-patch-plugin.js +53 -0
- package/lib/vite-plugins/vite-client-patch-plugin.js.map +1 -0
- package/package.json +10 -4
- package/src/module-alias/echarts-for-react.mjs +129 -0
- package/src/module-alias/echarts.mjs +14 -0
- package/src/module-alias/registry_echarts_theme.mjs +1 -1
- package/lib/vite-plugins/inspector-css-plugin.d.ts +0 -19
- package/lib/vite-plugins/inspector-css-plugin.d.ts.map +0 -1
- package/lib/vite-plugins/inspector-css-plugin.js +0 -70
- package/lib/vite-plugins/inspector-css-plugin.js.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Vite Client Patch Plugin
|
|
4
|
+
*
|
|
5
|
+
* 问题背景:
|
|
6
|
+
* 在云端开发环境(如通过反向代理 aiforce.run 访问)中,电脑休眠后唤醒,
|
|
7
|
+
* Vite HMR WebSocket 断连重连时会触发 location.reload()。
|
|
8
|
+
* 此时浏览器 HTTP/2 连接池中持有休眠前的死连接,reload 请求复用该死连接,
|
|
9
|
+
* 导致页面 blocked ~18s 后超时白屏(ERR_CONNECTION_TIMED_OUT)。
|
|
10
|
+
*
|
|
11
|
+
* 根本原因:
|
|
12
|
+
* Vite 的 @vite/client 在 vite:ws:disconnect 后调用 waitForSuccessfulPing(),
|
|
13
|
+
* WS ping 成功(新 TCP)后立即 location.reload(),
|
|
14
|
+
* 但 reload 走的是旧的死 HTTP/2 连接,不是新 TCP。
|
|
15
|
+
*
|
|
16
|
+
* 解决方案:
|
|
17
|
+
* 通过 Vite transform hook 拦截 @vite/client,直接移除 WS 重连后的 location.reload()。
|
|
18
|
+
* 用户若需要获取最新代码,手动刷新即可(符合云端 IDE 使用预期)。
|
|
19
|
+
*
|
|
20
|
+
* 适用范围:仅 dev server (apply: 'serve')
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.viteClientPatchPlugin = viteClientPatchPlugin;
|
|
24
|
+
/**
|
|
25
|
+
* 匹配 vite:ws:disconnect 处理器中的重连刷新代码:
|
|
26
|
+
* await waitForSuccessfulPing(url.href);
|
|
27
|
+
* location.reload();
|
|
28
|
+
*/
|
|
29
|
+
const RECONNECT_RELOAD_PATTERN = /(await waitForSuccessfulPing\(url\.href\);)\r?\n(\s*)location\.reload\(\);/;
|
|
30
|
+
function viteClientPatchPlugin() {
|
|
31
|
+
return {
|
|
32
|
+
name: 'fullstack-vite-client-patch',
|
|
33
|
+
enforce: 'post',
|
|
34
|
+
apply: 'serve',
|
|
35
|
+
transform(code, id) {
|
|
36
|
+
if (!id.includes('vite/dist/client/client.mjs')) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (!RECONNECT_RELOAD_PATTERN.test(code)) {
|
|
40
|
+
console.warn('[fullstack-vite-client-patch] Warning: Could not find the reconnect-reload pattern ' +
|
|
41
|
+
'in @vite/client. The patch has NOT been applied. ' +
|
|
42
|
+
'Check if this Vite version changed the vite:ws:disconnect handler.');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// Remove location.reload() — suppress auto-reload after WS reconnect.
|
|
46
|
+
// In cloud environments, the browser's stale HTTP/2 connection causes ~18s timeout on reload.
|
|
47
|
+
// Users can manually refresh when needed.
|
|
48
|
+
const patchedCode = code.replace(RECONNECT_RELOAD_PATTERN, (_, pingLine) => pingLine);
|
|
49
|
+
return { code: patchedCode };
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=vite-client-patch-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-client-patch-plugin.js","sourceRoot":"","sources":["../../src/vite-plugins/vite-client-patch-plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAYH,sDA+BC;AAvCD;;;;GAIG;AACH,MAAM,wBAAwB,GAC5B,4EAA4E,CAAC;AAE/E,SAAgB,qBAAqB;IACnC,OAAO;QACL,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,OAAO;QAEd,SAAS,CAAC,IAAI,EAAE,EAAE;YAChB,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC,EAAE,CAAC;gBAChD,OAAO;YACT,CAAC;YAED,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzC,OAAO,CAAC,IAAI,CACV,qFAAqF;oBACnF,mDAAmD;oBACnD,oEAAoE,CACvE,CAAC;gBACF,OAAO;YACT,CAAC;YAED,sEAAsE;YACtE,8FAA8F;YAC9F,0CAA0C;YAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAC9B,wBAAwB,EACxB,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAC1B,CAAC;YAEF,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;QAC/B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-vite-preset",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.21",
|
|
4
4
|
"files": [
|
|
5
5
|
"lib",
|
|
6
6
|
"src/empty.css",
|
|
7
7
|
"src/inspector-stub.js",
|
|
8
8
|
"src/module-alias/clsx.mjs",
|
|
9
9
|
"src/module-alias/echarts.mjs",
|
|
10
|
+
"src/module-alias/echarts-for-react.mjs",
|
|
10
11
|
"src/module-alias/registry_echarts_theme.mjs",
|
|
11
12
|
"src/overlay"
|
|
12
13
|
],
|
|
@@ -32,14 +33,19 @@
|
|
|
32
33
|
"@babel/parser": "^7.28.0",
|
|
33
34
|
"@babel/traverse": "^7.28.0",
|
|
34
35
|
"@babel/types": "^7.28.2",
|
|
35
|
-
"@lark-apaas/devtool-kits": "1.2.16-beta.
|
|
36
|
-
"@lark-apaas/
|
|
37
|
-
"@lark-apaas/vite-inspector-plugin": "^1.0.
|
|
36
|
+
"@lark-apaas/devtool-kits": "1.2.16-beta.5",
|
|
37
|
+
"@lark-apaas/styled-jsx": "^1.0.1",
|
|
38
|
+
"@lark-apaas/vite-inspector-plugin": "^1.0.2",
|
|
38
39
|
"@vitejs/plugin-react": "^4.5.0",
|
|
39
40
|
"clsx": "^2.1.1",
|
|
40
41
|
"colorjs.io": "^0.5.2",
|
|
42
|
+
"core-js": "^3.40.0",
|
|
41
43
|
"dotenv": "^16.4.5",
|
|
42
44
|
"echarts": "^6.0.0",
|
|
45
|
+
"echarts-for-react": "^3.0.2",
|
|
46
|
+
"glob": "^11.0.0",
|
|
47
|
+
"html-minifier-terser": "^7.2.0",
|
|
48
|
+
"lightningcss": "^1.28.0",
|
|
43
49
|
"postcss-import": "^16.1.1",
|
|
44
50
|
"styled-jsx": "^5.1.6",
|
|
45
51
|
"tailwind-merge": "^2.5.5",
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import OriginalReactECharts from 'echarts-for-react';
|
|
3
|
+
import Color from 'colorjs.io';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Convert HSL/HSLA color to hex or rgba
|
|
7
|
+
*/
|
|
8
|
+
export function convertColorToHex(color) {
|
|
9
|
+
if (typeof color !== 'string') return color;
|
|
10
|
+
|
|
11
|
+
const trimmed = color.trim();
|
|
12
|
+
if (!trimmed.startsWith('hsl')) {
|
|
13
|
+
return color;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const colorObj = new Color(trimmed);
|
|
18
|
+
|
|
19
|
+
if (colorObj.alpha < 1) {
|
|
20
|
+
return colorObj.to('srgb').toString({ format: 'rgba' });
|
|
21
|
+
} else {
|
|
22
|
+
return colorObj.to('srgb').toString({ format: 'hex' });
|
|
23
|
+
}
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.warn(`Failed to convert color: ${color}`, error);
|
|
26
|
+
return color;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function convertColorValue(propValue, visited) {
|
|
31
|
+
if (typeof propValue === 'string') {
|
|
32
|
+
return convertColorToHex(propValue);
|
|
33
|
+
}
|
|
34
|
+
if (Array.isArray(propValue)) {
|
|
35
|
+
return propValue.map((item) =>
|
|
36
|
+
typeof item === 'string' ? convertColorToHex(item) : transformColors(item, visited)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return transformColors(propValue, visited);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Deep traverse object to transform all HSL colors in 'color' property
|
|
44
|
+
*/
|
|
45
|
+
export function transformColors(value, visited = new WeakSet()) {
|
|
46
|
+
if (value === null || value === undefined) return value;
|
|
47
|
+
if (typeof value !== 'object') return value;
|
|
48
|
+
if (visited.has(value)) return value;
|
|
49
|
+
if (value instanceof Date || value instanceof RegExp) return value;
|
|
50
|
+
|
|
51
|
+
visited.add(value);
|
|
52
|
+
|
|
53
|
+
if (Array.isArray(value)) {
|
|
54
|
+
return value.map((item) => transformColors(item, visited));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const result = {};
|
|
58
|
+
for (const key in value) {
|
|
59
|
+
if (!Object.prototype.hasOwnProperty.call(value, key)) continue;
|
|
60
|
+
|
|
61
|
+
const propValue = value[key];
|
|
62
|
+
|
|
63
|
+
if (key === 'color') {
|
|
64
|
+
if (typeof propValue === 'function') {
|
|
65
|
+
result[key] = (...args) => convertColorValue(propValue(...args), visited);
|
|
66
|
+
} else {
|
|
67
|
+
result[key] = convertColorValue(propValue, visited);
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
result[key] = transformColors(propValue, visited);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Remove label.color and emphasis.label.color from funnel series
|
|
79
|
+
* to let ECharts use default contrast colors
|
|
80
|
+
*/
|
|
81
|
+
function removeFunnelLabelColor(option) {
|
|
82
|
+
if (!Array.isArray(option.series)) return option;
|
|
83
|
+
|
|
84
|
+
const series = option.series.map((item) => {
|
|
85
|
+
if (item?.type !== 'funnel') return item;
|
|
86
|
+
|
|
87
|
+
let result = { ...item };
|
|
88
|
+
|
|
89
|
+
// remove label.color
|
|
90
|
+
if (result.label && typeof result.label === 'object') {
|
|
91
|
+
const { color: _, ...labelRest } = result.label;
|
|
92
|
+
result = { ...result, label: labelRest };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// remove emphasis.label.color
|
|
96
|
+
const emphasis = result.emphasis;
|
|
97
|
+
if (emphasis?.label && typeof emphasis.label === 'object') {
|
|
98
|
+
const { color: _, ...emphasisLabelRest } = emphasis.label;
|
|
99
|
+
result = { ...result, emphasis: { ...emphasis, label: emphasisLabelRest } };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return result;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
return { ...option, series };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* EChartsReact wrapper component
|
|
110
|
+
* - Automatically converts HSL colors to hex in option
|
|
111
|
+
* - Removes label.color from funnel series
|
|
112
|
+
*/
|
|
113
|
+
export class EChartsReact extends React.Component {
|
|
114
|
+
render() {
|
|
115
|
+
const { option, ...rest } = this.props;
|
|
116
|
+
|
|
117
|
+
const transformedOption = option
|
|
118
|
+
? removeFunnelLabelColor(transformColors(option))
|
|
119
|
+
: option;
|
|
120
|
+
|
|
121
|
+
return React.createElement(OriginalReactECharts, {
|
|
122
|
+
option: transformedOption,
|
|
123
|
+
...rest,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export * from 'echarts-for-react';
|
|
129
|
+
export default EChartsReact;
|
|
@@ -2,10 +2,23 @@ import * as echartsNamespace from 'echarts';
|
|
|
2
2
|
export { echartsNamespace as echarts };
|
|
3
3
|
export * from 'echarts';
|
|
4
4
|
|
|
5
|
+
import * as echarts from 'echarts';
|
|
5
6
|
import { registerTheme } from 'echarts';
|
|
6
7
|
import { getShadcnEChartsTheme } from './registry_echarts_theme.mjs';
|
|
7
8
|
|
|
8
9
|
let isRegistered = false;
|
|
10
|
+
let isWindowMounted = false;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Mount echarts to window for debugging
|
|
14
|
+
*/
|
|
15
|
+
export function registerEchartsToWindow() {
|
|
16
|
+
if (isWindowMounted || typeof globalThis.window === 'undefined') {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
isWindowMounted = true;
|
|
20
|
+
globalThis.echarts = echarts;
|
|
21
|
+
}
|
|
9
22
|
|
|
10
23
|
export function resgisterEchartsTheme() {
|
|
11
24
|
// Register ud theme, only register once globally
|
|
@@ -26,4 +39,5 @@ export function resgisterEchartsTheme() {
|
|
|
26
39
|
}
|
|
27
40
|
}
|
|
28
41
|
|
|
42
|
+
registerEchartsToWindow();
|
|
29
43
|
resgisterEchartsTheme();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from 'vite';
|
|
2
|
-
/**
|
|
3
|
-
* Vite plugin to handle inspector CSS imports
|
|
4
|
-
*
|
|
5
|
-
* Creates an empty inspector.dev.css stub file if it doesn't exist.
|
|
6
|
-
* This is needed because:
|
|
7
|
-
* 1. @lark-apaas/client-toolkit imports @/inspector.dev.css
|
|
8
|
-
* 2. Vite's internal postcss-import processes @import statements before
|
|
9
|
-
* custom plugins can intercept them
|
|
10
|
-
* 3. The inspector UI injects its own styles at runtime, so this file
|
|
11
|
-
* can be empty
|
|
12
|
-
*
|
|
13
|
-
* In production mode, the stub file is cleaned up after build.
|
|
14
|
-
* In development mode, the stub file is kept (or user can provide real CSS).
|
|
15
|
-
*/
|
|
16
|
-
export declare function inspectorCssPlugin(options: {
|
|
17
|
-
isDev: boolean;
|
|
18
|
-
}): Plugin;
|
|
19
|
-
//# sourceMappingURL=inspector-css-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspector-css-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/inspector-css-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAKnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CA8CtE"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.inspectorCssPlugin = inspectorCssPlugin;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const INSPECTOR_CSS_FILENAME = 'inspector.dev.css';
|
|
10
|
-
const EMPTY_CSS_CONTENT = '/* Inspector CSS - placeholder for postcss-import */\n';
|
|
11
|
-
/**
|
|
12
|
-
* Vite plugin to handle inspector CSS imports
|
|
13
|
-
*
|
|
14
|
-
* Creates an empty inspector.dev.css stub file if it doesn't exist.
|
|
15
|
-
* This is needed because:
|
|
16
|
-
* 1. @lark-apaas/client-toolkit imports @/inspector.dev.css
|
|
17
|
-
* 2. Vite's internal postcss-import processes @import statements before
|
|
18
|
-
* custom plugins can intercept them
|
|
19
|
-
* 3. The inspector UI injects its own styles at runtime, so this file
|
|
20
|
-
* can be empty
|
|
21
|
-
*
|
|
22
|
-
* In production mode, the stub file is cleaned up after build.
|
|
23
|
-
* In development mode, the stub file is kept (or user can provide real CSS).
|
|
24
|
-
*/
|
|
25
|
-
function inspectorCssPlugin(options) {
|
|
26
|
-
const { isDev } = options;
|
|
27
|
-
let createdStubFile = null;
|
|
28
|
-
return {
|
|
29
|
-
name: 'vite-inspector-css',
|
|
30
|
-
enforce: 'pre',
|
|
31
|
-
configResolved(config) {
|
|
32
|
-
const rootDir = config.root || process.cwd();
|
|
33
|
-
const stubPath = path_1.default.resolve(rootDir, 'client/src', INSPECTOR_CSS_FILENAME);
|
|
34
|
-
// Create stub file if it doesn't exist (both dev and production)
|
|
35
|
-
// This prevents Vite's internal postcss-import from failing
|
|
36
|
-
if (!fs_1.default.existsSync(stubPath)) {
|
|
37
|
-
try {
|
|
38
|
-
// Ensure directory exists
|
|
39
|
-
const dir = path_1.default.dirname(stubPath);
|
|
40
|
-
if (!fs_1.default.existsSync(dir)) {
|
|
41
|
-
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
42
|
-
}
|
|
43
|
-
fs_1.default.writeFileSync(stubPath, EMPTY_CSS_CONTENT);
|
|
44
|
-
// Only track for cleanup in production mode
|
|
45
|
-
if (!isDev) {
|
|
46
|
-
createdStubFile = stubPath;
|
|
47
|
-
}
|
|
48
|
-
console.log(`[vite-inspector-css] Created stub: ${stubPath}`);
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
console.warn(`[vite-inspector-css] Could not create stub file: ${e}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
buildEnd() {
|
|
56
|
-
// Clean up the stub file after production build completes
|
|
57
|
-
if (createdStubFile && fs_1.default.existsSync(createdStubFile)) {
|
|
58
|
-
try {
|
|
59
|
-
fs_1.default.unlinkSync(createdStubFile);
|
|
60
|
-
console.log(`[vite-inspector-css] Cleaned up stub: ${createdStubFile}`);
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
console.warn(`[vite-inspector-css] Could not clean up stub file: ${e}`);
|
|
64
|
-
}
|
|
65
|
-
createdStubFile = null;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=inspector-css-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspector-css-plugin.js","sourceRoot":"","sources":["../../src/vite-plugins/inspector-css-plugin.ts"],"names":[],"mappings":";;;;;AAqBA,gDA8CC;AAnED,4CAAoB;AACpB,gDAAwB;AAGxB,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,iBAAiB,GAAG,wDAAwD,CAAC;AAEnF;;;;;;;;;;;;;GAaG;AACH,SAAgB,kBAAkB,CAAC,OAA2B;IAC5D,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,IAAI,eAAe,GAAkB,IAAI,CAAC;IAE1C,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,KAAK;QAEd,cAAc,CAAC,MAAsB;YACnC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAC7C,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;YAE7E,iEAAiE;YACjE,4DAA4D;YAC5D,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC7B,IAAI,CAAC;oBACH,0BAA0B;oBAC1B,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBACnC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;wBACxB,YAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;oBACzC,CAAC;oBACD,YAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;oBAC9C,4CAA4C;oBAC5C,IAAI,CAAC,KAAK,EAAE,CAAC;wBACX,eAAe,GAAG,QAAQ,CAAC;oBAC7B,CAAC;oBACD,OAAO,CAAC,GAAG,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;gBAChE,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC,EAAE,CAAC,CAAC;gBACxE,CAAC;YACH,CAAC;QACH,CAAC;QAED,QAAQ;YACN,0DAA0D;YAC1D,IAAI,eAAe,IAAI,YAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;gBACtD,IAAI,CAAC;oBACH,YAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;oBAC/B,OAAO,CAAC,GAAG,CAAC,yCAAyC,eAAe,EAAE,CAAC,CAAC;gBAC1E,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,IAAI,CAAC,sDAAsD,CAAC,EAAE,CAAC,CAAC;gBAC1E,CAAC;gBACD,eAAe,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|