@lark-apaas/coding-templates 0.1.14 → 0.1.15
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/package.json
CHANGED
|
@@ -4,11 +4,9 @@ import HomePage from "@/pages/home";
|
|
|
4
4
|
import TodosPage from "@/pages/todos";
|
|
5
5
|
import NotFoundPage from "@/pages/not-found";
|
|
6
6
|
|
|
7
|
-
declare const __APP_BASE_PATH__: string;
|
|
8
|
-
|
|
9
7
|
export default function App() {
|
|
10
8
|
return (
|
|
11
|
-
<BrowserRouter basename={
|
|
9
|
+
<BrowserRouter basename={process.env.CLIENT_BASE_PATH || '/'}>
|
|
12
10
|
<Routes>
|
|
13
11
|
<Route element={<Layout />}>
|
|
14
12
|
<Route index element={<HomePage />} />
|
|
@@ -6,6 +6,11 @@ OUTPUT="$ROOT/dist/output"
|
|
|
6
6
|
OUTPUT_RESOURCE="$ROOT/dist/output_resource"
|
|
7
7
|
OUTPUT_STATIC="$ROOT/dist/output_static"
|
|
8
8
|
|
|
9
|
+
# 映射平台环境变量到 preset 期望的变量名
|
|
10
|
+
export CLIENT_BASE_PATH="${MCLAW_APP_ID:+/app/$MCLAW_APP_ID}"
|
|
11
|
+
export ASSETS_CDN_PATH="${MCLAW_CDN_DOMAIN:-/}"
|
|
12
|
+
export NODE_ENV="${NODE_ENV:-production}"
|
|
13
|
+
|
|
9
14
|
# 清理
|
|
10
15
|
rm -rf "$ROOT/dist"
|
|
11
16
|
|