fix: 修复生产模式静态文件路径 build->dist
This commit is contained in:
@@ -352,14 +352,14 @@ async function startServer() {
|
||||
if (isDev) {
|
||||
app.use(express.static(path.join(__dirname, '../dist')));
|
||||
} else {
|
||||
app.use(express.static(path.join(__dirname, '../build')));
|
||||
app.use(express.static(path.join(__dirname, '../dist')));
|
||||
}
|
||||
|
||||
app.use((req, res) => {
|
||||
if (isDev) {
|
||||
res.sendFile(path.join(__dirname, '../dist/index.html'));
|
||||
} else {
|
||||
res.sendFile(path.join(__dirname, '../build/index.html'));
|
||||
res.sendFile(path.join(__dirname, '../dist/index.html'));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user