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