Skip to content

Commit 6c811cd

Browse files
committed
fix preview and admin structure
1 parent 4c6639d commit 6c811cd

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

admin/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<div id="root"></div>
11-
<script type="module" src="/src/pages/admin/main.tsx"></script>
11+
<script type="module" src="/admin/main.tsx"></script>
1212
</body>
1313
</html>
File renamed without changes.

preview/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>raduwen-obs-widget</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/preview/main.tsx"></script>
12+
</body>
13+
</html>
File renamed without changes.

vite.config.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
import { defineConfig } from 'vite';
22
import reactRefresh from '@vitejs/plugin-react-refresh';
33
import tsconfigPaths from 'vite-tsconfig-paths';
4-
import { resolve } from 'path';
4+
import mpa from 'vite-plugin-mpa';
5+
6+
var plugins = [tsconfigPaths()];
7+
8+
if (process.env.NODE_ENV !== "production") {
9+
plugins.push(reactRefresh());
10+
plugins.push(mpa({
11+
scanDir: '.'
12+
})
13+
);
14+
}
515

616
// https://vitejs.dev/config/
717
export default defineConfig({
818
build: {
919
rollupOptions: {
1020
input: {
11-
main: resolve(__dirname, 'index.html'),
12-
admin: resolve(__dirname, 'admin/index.html'),
21+
preview: 'preview/index.html',
22+
admin: 'admin/index.html'
1323
}
1424
}
1525
},
16-
plugins: [tsconfigPaths(), reactRefresh()]
26+
plugins,
1727
});

0 commit comments

Comments
 (0)