@lark-apaas/fullstack-vite-preset 1.0.1-beta.3 → 1.0.1-beta.30
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/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- 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/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 +146 -16
- package/lib/preset.js.map +1 -1
- package/lib/vite-plugins/banner-plugin.d.ts +3 -0
- package/lib/vite-plugins/banner-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/banner-plugin.js +26 -0
- package/lib/vite-plugins/banner-plugin.js.map +1 -0
- 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.map +1 -1
- package/lib/vite-plugins/html-output-plugin.js +3 -5
- package/lib/vite-plugins/html-output-plugin.js.map +1 -1
- package/lib/vite-plugins/miaoda-fonts-mirror-plugin.d.ts +14 -0
- package/lib/vite-plugins/miaoda-fonts-mirror-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/miaoda-fonts-mirror-plugin.js +99 -0
- package/lib/vite-plugins/miaoda-fonts-mirror-plugin.js.map +1 -0
- 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/preconnect-plugin.d.ts +31 -0
- package/lib/vite-plugins/preconnect-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/preconnect-plugin.js +65 -0
- package/lib/vite-plugins/preconnect-plugin.js.map +1 -0
- package/lib/vite-plugins/route-parser-plugin.d.ts +1 -0
- package/lib/vite-plugins/route-parser-plugin.d.ts.map +1 -1
- package/lib/vite-plugins/route-parser-plugin.js +12 -218
- package/lib/vite-plugins/route-parser-plugin.js.map +1 -1
- package/lib/vite-plugins/runtime-injection-plugin.js +1 -1
- package/lib/vite-plugins/runtime-injection-plugin.js.map +1 -1
- package/lib/vite-plugins/slardar-plugin.d.ts.map +1 -1
- package/lib/vite-plugins/slardar-plugin.js +68 -5
- package/lib/vite-plugins/slardar-plugin.js.map +1 -1
- package/lib/vite-plugins/source-map-upload-plugin.d.ts +7 -0
- package/lib/vite-plugins/source-map-upload-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/source-map-upload-plugin.js +85 -0
- package/lib/vite-plugins/source-map-upload-plugin.js.map +1 -0
- package/lib/vite-plugins/static-assets-plugin.d.ts.map +1 -1
- package/lib/vite-plugins/static-assets-plugin.js +113 -10
- package/lib/vite-plugins/static-assets-plugin.js.map +1 -1
- package/lib/vite-plugins/view-context-plugin.js +1 -1
- package/lib/vite-plugins/view-context-plugin.js.map +1 -1
- 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 +8 -5
- package/src/module-alias/echarts-for-react.mjs +52 -9
- package/src/module-alias/registry_echarts_theme.mjs +1 -1
- package/src/overlay/index.js +19 -1
- package/src/overlay/vite-client.js +37 -2
- 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
package/lib/index.d.ts
CHANGED
|
@@ -36,4 +36,6 @@ export type { CreateRecommendViteConfigOptions } from './preset';
|
|
|
36
36
|
export { createRecommendViteConfig } from './preset';
|
|
37
37
|
export { runtimeInjectionPlugin } from './vite-plugins/runtime-injection-plugin';
|
|
38
38
|
export type { RuntimeInjectionPluginOptions } from './vite-plugins/runtime-injection-plugin';
|
|
39
|
+
export { preconnectPlugin } from './vite-plugins/preconnect-plugin';
|
|
40
|
+
export type { PreconnectPluginOptions } from './vite-plugins/preconnect-plugin';
|
|
39
41
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAMpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,GAAE,UAAe,GACzB,UAAU,CAiCZ;AAGD,OAAO,EAAE,yBAAyB,IAAI,YAAY,EAAE,CAAC;AAGrD,YAAY,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,YAAY,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAMpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,GAAE,UAAe,GACzB,UAAU,CAiCZ;AAGD,OAAO,EAAE,yBAAyB,IAAI,YAAY,EAAE,CAAC;AAGrD,YAAY,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,YAAY,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runtimeInjectionPlugin = exports.createRecommendViteConfig = void 0;
|
|
3
|
+
exports.preconnectPlugin = exports.runtimeInjectionPlugin = exports.createRecommendViteConfig = void 0;
|
|
4
4
|
exports.createFullstackViteConfig = createFullstackViteConfig;
|
|
5
5
|
exports.defineConfig = createFullstackViteConfig;
|
|
6
6
|
const vite_1 = require("vite");
|
|
@@ -72,4 +72,6 @@ Object.defineProperty(exports, "createRecommendViteConfig", { enumerable: true,
|
|
|
72
72
|
// Re-export plugins for independent use
|
|
73
73
|
var runtime_injection_plugin_1 = require("./vite-plugins/runtime-injection-plugin");
|
|
74
74
|
Object.defineProperty(exports, "runtimeInjectionPlugin", { enumerable: true, get: function () { return runtime_injection_plugin_1.runtimeInjectionPlugin; } });
|
|
75
|
+
var preconnect_plugin_1 = require("./vite-plugins/preconnect-plugin");
|
|
76
|
+
Object.defineProperty(exports, "preconnectPlugin", { enumerable: true, get: function () { return preconnect_plugin_1.preconnectPlugin; } });
|
|
75
77
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAqCA,8DAmCC;AAGqC,iDAAY;AA3ElD,+BAAoD;AACpD,2DAA6D;AAE7D,qCAAqD;AACrD,qEAAoF;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,yBAAyB,CACvC,YAAwB,EAAE;IAE1B,yFAAyF;IACzF,IAAI,CAAC;QACH,8DAA8D;QAC9D,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,2EAA2E;IAC7E,CAAC;IAED,mDAAmD;IACnD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;IACpD,MAAM,kBAAkB,GAAG,KAAK,CAAC;IACjC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,OAAO,CAAC,CAAC,eAAe;IAEvE,+BAA+B;IAC/B,MAAM,cAAc,GAAG,IAAA,gCAAiB,EAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG,CAAC,CAAC;IAC9E,MAAM,UAAU,GAAG,IAAA,2DAAqC,EACtD,KAAK;QACH,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG;QACrC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,GAAG,CACvC,CAAC;IAEF,yDAAyD;IACzD,MAAM,UAAU,GAAG,IAAA,kCAAyB,EAAC;QAC3C,KAAK;QACL,kBAAkB;QAClB,UAAU;QACV,cAAc;QACd,UAAU;KACX,CAAC,CAAC;IAEH,mCAAmC;IACnC,OAAO,IAAA,kBAAW,EAAC,UAAU,EAAE,SA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IAAA,kBAAW,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AAC5C,CAAC;AAOD,mCAAqD;AAA5C,mHAAA,yBAAyB,OAAA;AAElC,wCAAwC;AACxC,oFAAiF;AAAxE,kIAAA,sBAAsB,OAAA;AAE/B,sEAAoE;AAA3D,qHAAA,gBAAgB,OAAA"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import OriginalReactECharts from 'echarts-for-react';
|
|
3
3
|
import type { EChartsReactProps } from 'echarts-for-react';
|
|
4
|
-
/**
|
|
5
|
-
* Convert HSL/HSLA color to hex or rgba
|
|
6
|
-
*/
|
|
7
|
-
export declare function convertColorToHex(color: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Deep traverse object to transform all HSL colors in 'color' property
|
|
10
|
-
*/
|
|
11
|
-
export declare function transformColors<T>(value: T, visited?: WeakSet<object>): T;
|
|
12
4
|
/**
|
|
13
5
|
* EChartsReact wrapper component
|
|
14
6
|
* - Automatically converts HSL colors to hex in option
|
|
7
|
+
* - Removes label.color from funnel series
|
|
15
8
|
*/
|
|
16
9
|
export declare class EChartsReact extends React.Component<EChartsReactProps> {
|
|
17
10
|
render(): React.CElement<EChartsReactProps, OriginalReactECharts>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echarts-for-react.d.ts","sourceRoot":"","sources":["../../src/module-alias/echarts-for-react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,oBAAoB,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"echarts-for-react.d.ts","sourceRoot":"","sources":["../../src/module-alias/echarts-for-react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,oBAAoB,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA+G3D;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC;IAClE,MAAM;CAYP;AAED,cAAc,mBAAmB,CAAC;AAClC,eAAe,YAAY,CAAC"}
|
|
@@ -18,8 +18,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.EChartsReact = void 0;
|
|
21
|
-
exports.convertColorToHex = convertColorToHex;
|
|
22
|
-
exports.transformColors = transformColors;
|
|
23
21
|
const react_1 = __importDefault(require("react"));
|
|
24
22
|
const echarts_for_react_1 = __importDefault(require("echarts-for-react"));
|
|
25
23
|
const colorjs_io_1 = __importDefault(require("colorjs.io"));
|
|
@@ -47,6 +45,15 @@ function convertColorToHex(color) {
|
|
|
47
45
|
return color;
|
|
48
46
|
}
|
|
49
47
|
}
|
|
48
|
+
function convertColorValue(propValue, visited) {
|
|
49
|
+
if (typeof propValue === 'string') {
|
|
50
|
+
return convertColorToHex(propValue);
|
|
51
|
+
}
|
|
52
|
+
if (Array.isArray(propValue)) {
|
|
53
|
+
return propValue.map((item) => typeof item === 'string' ? convertColorToHex(item) : transformColors(item, visited));
|
|
54
|
+
}
|
|
55
|
+
return transformColors(propValue, visited);
|
|
56
|
+
}
|
|
50
57
|
/**
|
|
51
58
|
* Deep traverse object to transform all HSL colors in 'color' property
|
|
52
59
|
*/
|
|
@@ -59,8 +66,6 @@ function transformColors(value, visited = new WeakSet()) {
|
|
|
59
66
|
return value;
|
|
60
67
|
if (value instanceof Date || value instanceof RegExp)
|
|
61
68
|
return value;
|
|
62
|
-
if (typeof value === 'function')
|
|
63
|
-
return value;
|
|
64
69
|
visited.add(value);
|
|
65
70
|
if (Array.isArray(value)) {
|
|
66
71
|
return value.map((item) => transformColors(item, visited));
|
|
@@ -72,14 +77,11 @@ function transformColors(value, visited = new WeakSet()) {
|
|
|
72
77
|
continue;
|
|
73
78
|
const propValue = obj[key];
|
|
74
79
|
if (key === 'color') {
|
|
75
|
-
if (typeof propValue === '
|
|
76
|
-
result[key] =
|
|
77
|
-
}
|
|
78
|
-
else if (Array.isArray(propValue)) {
|
|
79
|
-
result[key] = propValue.map((item) => typeof item === 'string' ? convertColorToHex(item) : transformColors(item, visited));
|
|
80
|
+
if (typeof propValue === 'function') {
|
|
81
|
+
result[key] = (...args) => convertColorValue(propValue(...args), visited);
|
|
80
82
|
}
|
|
81
83
|
else {
|
|
82
|
-
result[key] =
|
|
84
|
+
result[key] = convertColorValue(propValue, visited);
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
else {
|
|
@@ -88,14 +90,46 @@ function transformColors(value, visited = new WeakSet()) {
|
|
|
88
90
|
}
|
|
89
91
|
return result;
|
|
90
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Remove label.color and emphasis.label.color from funnel series
|
|
95
|
+
* to let ECharts use default contrast colors
|
|
96
|
+
*/
|
|
97
|
+
function removeFunnelLabelColor(option) {
|
|
98
|
+
const opt = option;
|
|
99
|
+
if (!Array.isArray(opt.series))
|
|
100
|
+
return option;
|
|
101
|
+
const series = opt.series.map((item) => {
|
|
102
|
+
if (item?.type !== 'funnel')
|
|
103
|
+
return item;
|
|
104
|
+
let result = { ...item };
|
|
105
|
+
// remove label.color
|
|
106
|
+
if (result.label && typeof result.label === 'object') {
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
108
|
+
const { color: _, ...labelRest } = result.label;
|
|
109
|
+
result = { ...result, label: labelRest };
|
|
110
|
+
}
|
|
111
|
+
// remove emphasis.label.color
|
|
112
|
+
const emphasis = result.emphasis;
|
|
113
|
+
if (emphasis?.label && typeof emphasis.label === 'object') {
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
115
|
+
const { color: _, ...emphasisLabelRest } = emphasis.label;
|
|
116
|
+
result = { ...result, emphasis: { ...emphasis, label: emphasisLabelRest } };
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
119
|
+
});
|
|
120
|
+
return { ...opt, series };
|
|
121
|
+
}
|
|
91
122
|
/**
|
|
92
123
|
* EChartsReact wrapper component
|
|
93
124
|
* - Automatically converts HSL colors to hex in option
|
|
125
|
+
* - Removes label.color from funnel series
|
|
94
126
|
*/
|
|
95
127
|
class EChartsReact extends react_1.default.Component {
|
|
96
128
|
render() {
|
|
97
129
|
const { option, ...rest } = this.props;
|
|
98
|
-
const transformedOption = option
|
|
130
|
+
const transformedOption = option
|
|
131
|
+
? removeFunnelLabelColor(transformColors(option))
|
|
132
|
+
: option;
|
|
99
133
|
return react_1.default.createElement(echarts_for_react_1.default, {
|
|
100
134
|
option: transformedOption,
|
|
101
135
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echarts-for-react.js","sourceRoot":"","sources":["../../src/module-alias/echarts-for-react.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"echarts-for-react.js","sourceRoot":"","sources":["../../src/module-alias/echarts-for-react.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,0EAAqD;AAErD,4DAA+B;AAE/B;;GAEG;AACH,SAAS,iBAAiB,CAAC,KAAa;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE5C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,oBAAK,CAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,QAAQ,CAAC,EAAE,CAA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,CAAC;YACjD,CAAC,CAAC,MAAM,CAAC;QAEX,OAAO,eAAK,CAAC,aAAa,CAAC,2BAAoB,EAAE;YAC/C,MAAM,EAAE,iBAAiB;YACzB,GAAG,IAAI;SACR,CAAC,CAAC;IACL,CAAC;CACF;AAbD,oCAaC;AAED,oDAAkC;AAClC,kBAAe,YAAY,CAAC"}
|
|
@@ -8,9 +8,7 @@ export declare function getCssVariable(varName: string, element?: HTMLElement):
|
|
|
8
8
|
export declare function generateEChartsTheme(element?: HTMLElement): {
|
|
9
9
|
color: string[];
|
|
10
10
|
backgroundColor: string;
|
|
11
|
-
textStyle: {
|
|
12
|
-
color: string;
|
|
13
|
-
};
|
|
11
|
+
textStyle: {};
|
|
14
12
|
title: {
|
|
15
13
|
textStyle: {
|
|
16
14
|
color: string;
|
|
@@ -352,9 +350,7 @@ export declare function generateEChartsTheme(element?: HTMLElement): {
|
|
|
352
350
|
export declare function getShadcnEChartsTheme(): {
|
|
353
351
|
color: string[];
|
|
354
352
|
backgroundColor: string;
|
|
355
|
-
textStyle: {
|
|
356
|
-
color: string;
|
|
357
|
-
};
|
|
353
|
+
textStyle: {};
|
|
358
354
|
title: {
|
|
359
355
|
textStyle: {
|
|
360
356
|
color: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry_echarts_theme.d.ts","sourceRoot":"","sources":["../../src/module-alias/registry_echarts_theme.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,cAAgB,GAAG,MAAM,CAS/E;AAGD,wBAAgB,oBAAoB,CAAC,OAAO,cAAgB
|
|
1
|
+
{"version":3,"file":"registry_echarts_theme.d.ts","sourceRoot":"","sources":["../../src/module-alias/registry_echarts_theme.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,cAAgB,GAAG,MAAM,CAS/E;AAGD,wBAA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 提供 iOS 15.4 以下版本需要的 polyfill
|
|
5
|
+
* 此文件会被单独打包成 polyfills.js,按需加载
|
|
6
|
+
*/
|
|
7
|
+
import 'core-js/actual/array/at';
|
|
8
|
+
import 'core-js/actual/string/at';
|
|
9
|
+
import 'core-js/actual/array/find-last';
|
|
10
|
+
import 'core-js/actual/array/find-last-index';
|
|
11
|
+
import 'core-js/actual/object/has-own';
|
|
12
|
+
import 'core-js/actual/promise/any';
|
|
13
|
+
import 'core-js/actual/aggregate-error';
|
|
14
|
+
import 'core-js/actual/structured-clone';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/polyfills/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,yBAAyB,CAAC;AACjC,OAAO,0BAA0B,CAAC;AAClC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,+BAA+B,CAAC;AACvC,OAAO,4BAA4B,CAAC;AACpC,OAAO,gCAAgC,CAAC;AACxC,OAAO,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* iOS 兼容性 Polyfills
|
|
4
|
+
*
|
|
5
|
+
* 使用 core-js 提供 iOS 15.4 以下版本需要的 polyfill
|
|
6
|
+
* 此文件会被单独打包成 polyfills.js,按需加载
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
// ECMAScript polyfills (core-js)
|
|
10
|
+
require("core-js/actual/array/at");
|
|
11
|
+
require("core-js/actual/string/at");
|
|
12
|
+
require("core-js/actual/array/find-last");
|
|
13
|
+
require("core-js/actual/array/find-last-index");
|
|
14
|
+
require("core-js/actual/object/has-own");
|
|
15
|
+
require("core-js/actual/promise/any");
|
|
16
|
+
require("core-js/actual/aggregate-error");
|
|
17
|
+
require("core-js/actual/structured-clone");
|
|
18
|
+
// Web Crypto API polyfill (不在 core-js 范围内)
|
|
19
|
+
if (typeof crypto !== 'undefined' && typeof crypto.randomUUID !== 'function') {
|
|
20
|
+
Object.defineProperty(crypto, 'randomUUID', {
|
|
21
|
+
value: function randomUUID() {
|
|
22
|
+
const bytes = new Uint8Array(16);
|
|
23
|
+
crypto.getRandomValues(bytes);
|
|
24
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
|
25
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
26
|
+
let hex = '';
|
|
27
|
+
for (let i = 0; i < 16; i++) {
|
|
28
|
+
hex += (bytes[i] < 16 ? '0' : '') + bytes[i].toString(16);
|
|
29
|
+
}
|
|
30
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
31
|
+
},
|
|
32
|
+
writable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/polyfills/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iCAAiC;AACjC,mCAAiC;AACjC,oCAAkC;AAClC,0CAAwC;AACxC,gDAA8C;AAC9C,yCAAuC;AACvC,sCAAoC;AACpC,0CAAwC;AACxC,2CAAyC;AAEzC,2CAA2C;AAC3C,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;IAC7E,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;QAC1C,KAAK,EAAE,SAAS,UAAU;YACxB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;YACjC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAC9B,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;YACpC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;YACpC,IAAI,GAAG,GAAG,EAAE,CAAC;YACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5B,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC5D,CAAC;YACD,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;QAC7G,CAAC;QACD,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC"}
|
package/lib/preset.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,MAAM,CAAC;AAiD9D,MAAM,WAAW,gCAAgC;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mCAAmC;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uBAAuB;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAaD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,gCAAgC,GACxC,UAAU,CAkeZ"}
|
package/lib/preset.js
CHANGED
|
@@ -4,12 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createRecommendViteConfig = createRecommendViteConfig;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
const plugin_react_1 = __importDefault(require("@vitejs/plugin-react"));
|
|
9
10
|
const vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
|
|
10
11
|
const vite_inspector_plugin_1 = require("@lark-apaas/vite-inspector-plugin");
|
|
11
12
|
const devtool_kits_1 = require("@lark-apaas/devtool-kits");
|
|
13
|
+
const vite_client_patch_plugin_1 = require("./vite-plugins/vite-client-patch-plugin");
|
|
12
14
|
const route_parser_plugin_1 = require("./vite-plugins/route-parser-plugin");
|
|
15
|
+
const preconnect_plugin_1 = require("./vite-plugins/preconnect-plugin");
|
|
13
16
|
const slardar_plugin_1 = require("./vite-plugins/slardar-plugin");
|
|
14
17
|
const view_context_plugin_1 = require("./vite-plugins/view-context-plugin");
|
|
15
18
|
const og_meta_plugin_1 = require("./vite-plugins/og-meta-plugin");
|
|
@@ -18,8 +21,13 @@ const html_output_plugin_1 = require("./vite-plugins/html-output-plugin");
|
|
|
18
21
|
const runtime_injection_plugin_1 = require("./vite-plugins/runtime-injection-plugin");
|
|
19
22
|
const error_overlay_plugin_1 = require("./vite-plugins/error-overlay-plugin");
|
|
20
23
|
const static_assets_plugin_1 = require("./vite-plugins/static-assets-plugin");
|
|
24
|
+
const css_legacy_plugin_1 = require("./vite-plugins/css-legacy-plugin");
|
|
25
|
+
const polyfill_plugin_1 = require("./vite-plugins/polyfill-plugin");
|
|
26
|
+
const source_map_upload_plugin_1 = require("./vite-plugins/source-map-upload-plugin");
|
|
21
27
|
const snapdom_proxy_1 = require("./utils/snapdom-proxy");
|
|
22
28
|
const hmr_timing_1 = require("./utils/hmr-timing");
|
|
29
|
+
const banner_plugin_1 = require("./vite-plugins/banner-plugin");
|
|
30
|
+
const miaoda_fonts_mirror_plugin_1 = require("./vite-plugins/miaoda-fonts-mirror-plugin");
|
|
23
31
|
function sendBackendUnavailable502(_err, _req, res) {
|
|
24
32
|
if (res.headersSent)
|
|
25
33
|
return;
|
|
@@ -32,14 +40,67 @@ function sendBackendUnavailable502(_err, _req, res) {
|
|
|
32
40
|
message: 'Backend service is not running',
|
|
33
41
|
}));
|
|
34
42
|
}
|
|
43
|
+
// 检查是否启用宽松 build 模式
|
|
44
|
+
const isLooseMode = process.env.FORCE_FRAMEWORK_BUILD_LOOSE_MODE === 'true';
|
|
45
|
+
function readAppFlags(rootDir) {
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(rootDir, 'package.json'), 'utf-8')).flags || {};
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
35
53
|
function createRecommendViteConfig(options) {
|
|
36
54
|
const { isDev = true, enableReactRefresh = isDev, needRoutes = true, clientBasePath = '', publicPath = '', codeSplitting = true, } = options;
|
|
37
55
|
// Inspector can be disabled via environment variable
|
|
38
56
|
const enableInspector = isDev && process.env.DISABLE_INSPECTOR !== 'true';
|
|
39
57
|
const rootDir = process.cwd();
|
|
40
58
|
const serverPort = process.env.SERVER_PORT || '3000';
|
|
59
|
+
const appFlags = readAppFlags(rootDir);
|
|
60
|
+
// 优先从环境变量获取 RELEASE_ID,否则使用时间戳作为兜底
|
|
61
|
+
const releaseId = process.env.RELEASE_ID || new Date().toISOString();
|
|
62
|
+
// 从 clientBasePath(如 /app/app123)中提取 appId,用于构造旧路径代理规则
|
|
63
|
+
// 仅在新路径格式(/app/:appId)下启用旧路径兼容
|
|
64
|
+
const isNewPathFormat = /^\/app\/[^/]/.test(clientBasePath);
|
|
65
|
+
const appId = isNewPathFormat
|
|
66
|
+
? clientBasePath.replace(/\/+$/, '').split('/').pop()
|
|
67
|
+
: '';
|
|
68
|
+
// 当 publicPath 是绝对 URL(即静态资源走跨域 CDN,典型的 miaoda 线上部署场景)时,
|
|
69
|
+
// 从中派生出 CDN origin 用于 preconnect,让浏览器提前建连,减少关键资源等待时间。
|
|
70
|
+
// Dev 模式下 publicPath 是同域路径(如 /app/xxx),不需要 preconnect。
|
|
71
|
+
const assetOriginsForPreconnect = [];
|
|
72
|
+
if (!isDev && typeof publicPath === 'string' && /^https?:\/\//.test(publicPath)) {
|
|
73
|
+
assetOriginsForPreconnect.push(publicPath);
|
|
74
|
+
}
|
|
75
|
+
// 读取构建前生成的路由定义 JSON,供 define 注入到 bundle
|
|
76
|
+
// build.sh 在 client 构建之前已将 page-routes.json / api-routes.json 写入 dist/
|
|
77
|
+
// 独立于 needRoutes(needRoutes 仅控制 RouteParserPlugin),只要文件存在就注入
|
|
78
|
+
let pageRouteDefinitions = [];
|
|
79
|
+
let apiRouteDefinitions = [];
|
|
80
|
+
try {
|
|
81
|
+
const pageRoutesPath = path_1.default.resolve(rootDir, 'dist/page-routes.json');
|
|
82
|
+
if (fs_1.default.existsSync(pageRoutesPath)) {
|
|
83
|
+
pageRouteDefinitions = JSON.parse(fs_1.default.readFileSync(pageRoutesPath, 'utf-8'));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch { /* ignore */ }
|
|
87
|
+
try {
|
|
88
|
+
const apiRoutesPath = path_1.default.resolve(rootDir, 'dist/api-routes.json');
|
|
89
|
+
if (fs_1.default.existsSync(apiRoutesPath)) {
|
|
90
|
+
apiRouteDefinitions = JSON.parse(fs_1.default.readFileSync(apiRoutesPath, 'utf-8'));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch { /* ignore */ }
|
|
41
94
|
// Build the plugins array
|
|
42
95
|
const plugins = [
|
|
96
|
+
// Cloud env patch: suppress auto page-reload on HMR WebSocket reconnect (dev only)
|
|
97
|
+
isDev && (0, vite_client_patch_plugin_1.viteClientPatchPlugin)(),
|
|
98
|
+
// aily-cli: add releaseId to window
|
|
99
|
+
(0, banner_plugin_1.bannerPlugin)(`window.__RELEASE_COMMIT_ID__ = '${releaseId}';`),
|
|
100
|
+
// miaoda-fonts-mirror: 编译时把 fonts.googleapis.com 替换为妙搭字体代理
|
|
101
|
+
// pathname 与 Google Fonts 完全一致,只换域名;存量应用重新编译即修复
|
|
102
|
+
// 关闭方式:设置环境变量 MIAODA_FONTS_MIRROR_OFF=1
|
|
103
|
+
(0, miaoda_fonts_mirror_plugin_1.miaodaFontsMirrorPlugin)(),
|
|
43
104
|
// Error overlay plugin - replaces Vite's native error overlay with custom one
|
|
44
105
|
// Must be first to intercept config and disable native overlay
|
|
45
106
|
// Only enabled in development mode
|
|
@@ -55,22 +116,22 @@ function createRecommendViteConfig(options) {
|
|
|
55
116
|
// Runtime injection plugin - injects @lark-apaas/client-toolkit/runtime
|
|
56
117
|
// Must be early to ensure runtime is loaded before app code
|
|
57
118
|
(0, runtime_injection_plugin_1.runtimeInjectionPlugin)({ clientBasePath }),
|
|
119
|
+
// Inspector plugin for dev mode (injects data attributes for debugging)
|
|
120
|
+
// Only enabled in development when DISABLE_INSPECTOR is not set
|
|
121
|
+
// Must be BEFORE react() — both use enforce:'pre' and Vite runs them in array order.
|
|
122
|
+
// If react() runs first, its Babel transform converts JSX to _jsxDEV() calls,
|
|
123
|
+
// leaving no JSX elements for the inspector to annotate.
|
|
124
|
+
enableInspector && (0, vite_inspector_plugin_1.inspectorPlugin)(),
|
|
58
125
|
// React plugin with Babel for styled-jsx support
|
|
126
|
+
// 宽松模式下使用 @lark-apaas/styled-jsx/babel(对齐 rspack-preset),否则使用社区版
|
|
59
127
|
(0, plugin_react_1.default)({
|
|
60
128
|
jsxRuntime: 'automatic',
|
|
61
|
-
// Only use inspector jsx-runtime in dev mode when inspector is enabled
|
|
62
|
-
jsxImportSource: enableInspector
|
|
63
|
-
? '@lark-apaas/miaoda-inspector-jsx-runtime'
|
|
64
|
-
: 'react',
|
|
65
129
|
babel: {
|
|
66
|
-
plugins: [['styled-jsx/babel']],
|
|
130
|
+
plugins: [[isLooseMode ? '@lark-apaas/styled-jsx/babel' : 'styled-jsx/babel']],
|
|
67
131
|
},
|
|
68
132
|
// Only enable fast refresh in dev mode
|
|
69
133
|
...(enableReactRefresh ? {} : { fastRefresh: false }),
|
|
70
134
|
}),
|
|
71
|
-
// Inspector plugin for dev mode (injects data attributes for debugging)
|
|
72
|
-
// Only enabled in development when DISABLE_INSPECTOR is not set
|
|
73
|
-
enableInspector && (0, vite_inspector_plugin_1.inspectorPlugin)(),
|
|
74
135
|
// Module alias plugin for clsx and echarts
|
|
75
136
|
(0, module_alias_plugin_1.moduleAliasPlugin)(),
|
|
76
137
|
// Route parser plugin (when needRoutes is true)
|
|
@@ -83,12 +144,32 @@ function createRecommendViteConfig(options) {
|
|
|
83
144
|
serveBasePath: clientBasePath,
|
|
84
145
|
...(isDev ? { basePath: '' } : {}),
|
|
85
146
|
}),
|
|
147
|
+
// OG Meta tags injection plugin
|
|
148
|
+
// 通过字符串 replace('</head>', ...) 操作 head 末尾,与 head-prepend bucket 独立,
|
|
149
|
+
// 位置不影响最终 HTML;放在 slardar/viewContext 之前,避免夹在那对"反转 pair"中间。
|
|
150
|
+
(0, og_meta_plugin_1.ogMetaPlugin)(),
|
|
151
|
+
// 目标 head 顺序(对齐 fullstack-rspack-preset,业务 main.js 在最后):
|
|
152
|
+
// 1) ViewContext inline script(注入 window.tenantId/appId/userId/ENVIRONMENT)
|
|
153
|
+
// 2) Slardar loader / Performance / Tea(onload 中读取上述全局变量初始化)
|
|
154
|
+
// 3) [index.html 原 head 内容] + ogMeta 注入的 meta/title/icon
|
|
155
|
+
// 4) main.js(用户在 client/index.html 中写在 <body> 末尾,天然最后)
|
|
156
|
+
//
|
|
157
|
+
// 下面两个插件都用 injectTo: 'head-prepend'。Vite 对同一 bucket 是"后执行者插到更前",
|
|
158
|
+
// 因此数组里要把"想出现在更前面"的插件放到后面:slardar 先 → viewContext 后。
|
|
159
|
+
// 不要按直觉把 viewContext 调回 slardar 之前,会导致 slardar 出现在 viewContext 之上、
|
|
160
|
+
// onload 时拿不到 window.tenantId 等。也不要在这两个插件中间插入其它 head-prepend 插件。
|
|
161
|
+
// Preconnect to static asset CDN — only when publicPath is an absolute URL
|
|
162
|
+
// (prod deploy with CDN). Dev mode resources are same-origin, no preconnect needed.
|
|
163
|
+
assetOriginsForPreconnect.length > 0 &&
|
|
164
|
+
(0, preconnect_plugin_1.preconnectPlugin)({ origins: assetOriginsForPreconnect }),
|
|
86
165
|
// Performance monitoring plugin (Slardar + Tea)
|
|
87
166
|
(0, slardar_plugin_1.slardarPlugin)({ bid: 'apaas_miaoda' }),
|
|
88
167
|
// View context injection plugin
|
|
89
168
|
(0, view_context_plugin_1.viewContextPlugin)(),
|
|
90
|
-
//
|
|
91
|
-
(0,
|
|
169
|
+
// 生产环境:生成 legacy CSS 并注入检测脚本(对齐 rspack-preset)
|
|
170
|
+
!isDev && (0, css_legacy_plugin_1.cssLegacyPlugin)(),
|
|
171
|
+
// 生产环境:为旧浏览器提供 polyfill(仅在需要时加载,对齐 rspack-preset)
|
|
172
|
+
!isDev && (0, polyfill_plugin_1.polyfillPlugin)(),
|
|
92
173
|
// HTML output plugin - handles HTML path and dev mode disk write
|
|
93
174
|
(0, html_output_plugin_1.htmlOutputPlugin)({
|
|
94
175
|
isDev,
|
|
@@ -96,6 +177,11 @@ function createRecommendViteConfig(options) {
|
|
|
96
177
|
}),
|
|
97
178
|
// HMR timing plugin (dev only)
|
|
98
179
|
isDev && (0, hmr_timing_1.createHmrTimingPlugin)(),
|
|
180
|
+
// 生产环境下,收集 sourcemap
|
|
181
|
+
!isDev &&
|
|
182
|
+
(0, source_map_upload_plugin_1.sourceMapUploadPlugin)({
|
|
183
|
+
outputDir: path_1.default.resolve(rootDir, 'dist/sourcemaps'),
|
|
184
|
+
}),
|
|
99
185
|
];
|
|
100
186
|
const config = {
|
|
101
187
|
root: rootDir,
|
|
@@ -106,6 +192,10 @@ function createRecommendViteConfig(options) {
|
|
|
106
192
|
mainFields: ['module', 'browser', 'main'],
|
|
107
193
|
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
|
|
108
194
|
alias: {
|
|
195
|
+
// 确保所有 echarts 子路径导入(如 echarts/core, echarts/lib/...)
|
|
196
|
+
// 都解析到 preset 自带的 echarts,避免第三方扩展(如 echarts-wordcloud)
|
|
197
|
+
// 安装了独立的 echarts 副本导致注册不到同一个实例上
|
|
198
|
+
echarts: path_1.default.dirname(require.resolve('echarts/package.json')),
|
|
109
199
|
// Intercept @/inspector.dev.css import from client-toolkit
|
|
110
200
|
// In dev mode, inspector injects styles at runtime, so we use empty CSS
|
|
111
201
|
// This avoids creating files in user's project directory
|
|
@@ -136,6 +226,11 @@ function createRecommendViteConfig(options) {
|
|
|
136
226
|
// Build tool identifier for source map handling
|
|
137
227
|
// Vite dev mode doesn't need source map mapping - stack traces are already source paths
|
|
138
228
|
'process.env.BUILD_TOOL': JSON.stringify('vite'),
|
|
229
|
+
// 模板 flags 配置
|
|
230
|
+
'process.env.APP_FLAGS': JSON.stringify(appFlags),
|
|
231
|
+
// 路由定义,供客户端匹配 referer_path 和 api
|
|
232
|
+
'process.env.__PAGE_ROUTE_DEFINITIONS__': JSON.stringify(JSON.stringify(pageRouteDefinitions)),
|
|
233
|
+
'process.env.__API_ROUTE_DEFINITIONS__': JSON.stringify(JSON.stringify(apiRouteDefinitions)),
|
|
139
234
|
},
|
|
140
235
|
server: {
|
|
141
236
|
port: Number(process.env.CLIENT_DEV_PORT) || 8080,
|
|
@@ -181,6 +276,16 @@ function createRecommendViteConfig(options) {
|
|
|
181
276
|
});
|
|
182
277
|
},
|
|
183
278
|
},
|
|
279
|
+
// OpenAPI proxy
|
|
280
|
+
[`${clientBasePath}/openapi`]: {
|
|
281
|
+
target: `http://localhost:${serverPort}`,
|
|
282
|
+
changeOrigin: true,
|
|
283
|
+
configure: (proxy) => {
|
|
284
|
+
proxy.on('error', (err, req, res) => {
|
|
285
|
+
sendBackendUnavailable502(err, req, res);
|
|
286
|
+
});
|
|
287
|
+
},
|
|
288
|
+
},
|
|
184
289
|
// Inner API proxy
|
|
185
290
|
[`${clientBasePath}/__innerapi__`]: {
|
|
186
291
|
target: `http://localhost:${serverPort}`,
|
|
@@ -191,19 +296,44 @@ function createRecommendViteConfig(options) {
|
|
|
191
296
|
});
|
|
192
297
|
},
|
|
193
298
|
},
|
|
299
|
+
// 旧路径(/af/p/:appId)兼容代理,转发到 Node Server 由 legacy-path-redirect 中间件处理
|
|
300
|
+
...(appId
|
|
301
|
+
? {
|
|
302
|
+
[`/af/p/${appId}/api`]: {
|
|
303
|
+
target: `http://localhost:${serverPort}`,
|
|
304
|
+
changeOrigin: true,
|
|
305
|
+
configure: (proxy) => {
|
|
306
|
+
proxy.on('error', (err, req, res) => {
|
|
307
|
+
sendBackendUnavailable502(err, req, res);
|
|
308
|
+
});
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
[`/af/p/${appId}/__innerapi__`]: {
|
|
312
|
+
target: `http://localhost:${serverPort}`,
|
|
313
|
+
changeOrigin: true,
|
|
314
|
+
configure: (proxy) => {
|
|
315
|
+
proxy.on('error', (err, req, res) => {
|
|
316
|
+
sendBackendUnavailable502(err, req, res);
|
|
317
|
+
});
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
}
|
|
321
|
+
: {}),
|
|
194
322
|
},
|
|
195
323
|
},
|
|
196
324
|
build: {
|
|
197
325
|
outDir: path_1.default.resolve(rootDir, 'dist/client'),
|
|
198
326
|
emptyOutDir: false,
|
|
199
|
-
sourcemap: isDev,
|
|
327
|
+
sourcemap: isDev ? true : 'hidden', // Align with rspack-preset's devtool config
|
|
200
328
|
minify: !isDev ? 'esbuild' : false,
|
|
329
|
+
// 提高默认 warn limit — 拆 vendor 后单 chunk 仍可能略大,但不是问题
|
|
330
|
+
chunkSizeWarningLimit: 800,
|
|
201
331
|
rollupOptions: {
|
|
202
332
|
input: path_1.default.resolve(rootDir, 'client/index.html'),
|
|
203
333
|
output: {
|
|
204
334
|
// Code splitting: when disabled, all dynamic imports are inlined into single bundle
|
|
205
335
|
// When enabled (default), Vite will split chunks based on dynamic imports
|
|
206
|
-
...(codeSplitting ? {
|
|
336
|
+
...(!codeSplitting ? { inlineDynamicImports: true } : {}),
|
|
207
337
|
},
|
|
208
338
|
},
|
|
209
339
|
// Copy public directory
|
|
@@ -221,13 +351,11 @@ function createRecommendViteConfig(options) {
|
|
|
221
351
|
'react/jsx-dev-runtime',
|
|
222
352
|
'clsx',
|
|
223
353
|
'echarts',
|
|
354
|
+
'echarts-for-react',
|
|
224
355
|
// Include inspector so Vite pre-bundles it with its dependencies
|
|
225
356
|
...(enableInspector ? ['@lark-apaas/miaoda-inspector'] : []),
|
|
226
357
|
],
|
|
227
|
-
|
|
228
|
-
exclude: enableInspector
|
|
229
|
-
? ['@lark-apaas/miaoda-inspector-jsx-runtime']
|
|
230
|
-
: [],
|
|
358
|
+
exclude: [],
|
|
231
359
|
// Pass define replacements to esbuild for pre-bundling
|
|
232
360
|
// Without this, process.env.X in dependencies won't be replaced
|
|
233
361
|
esbuildOptions: {
|
|
@@ -268,6 +396,7 @@ function createRecommendViteConfig(options) {
|
|
|
268
396
|
}),
|
|
269
397
|
(0, devtool_kits_1.createOpenapiMiddleware)({
|
|
270
398
|
openapiFilePath: path_1.default.resolve(rootDir, './client/src/api/gen/openapi.json'),
|
|
399
|
+
openapiSpecFilePath: path_1.default.resolve(rootDir, './docs/openapi.json'),
|
|
271
400
|
serverDir: path_1.default.resolve(rootDir, './server'),
|
|
272
401
|
enableEnhancement: true,
|
|
273
402
|
}),
|
|
@@ -296,6 +425,7 @@ function createRecommendViteConfig(options) {
|
|
|
296
425
|
const isStaticAsset = /\.(js|css|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot)$/i.test(pathname);
|
|
297
426
|
if (isHtmlRequest && !isDevServerPath && !isStaticAsset) {
|
|
298
427
|
// Forward to backend server
|
|
428
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
299
429
|
const http = require('http');
|
|
300
430
|
const proxyReq = http.request({
|
|
301
431
|
hostname: 'localhost',
|