mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
refactor: have build served from dist folder
This commit is contained in:
parent
6498ab79a4
commit
eb2d9bac33
2 changed files with 4 additions and 15 deletions
|
|
@ -23,7 +23,7 @@ const projectPath = path.join(__dirname, '..', '..', 'client');
|
||||||
app.use(errorController);
|
app.use(errorController);
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(express.static(path.join(projectPath, 'public')));
|
app.use(express.static(path.join(projectPath, 'dist')));
|
||||||
app.set('trust proxy', 1); // trust first proxy
|
app.set('trust proxy', 1); // trust first proxy
|
||||||
app.use(
|
app.use(
|
||||||
session({
|
session({
|
||||||
|
|
@ -69,7 +69,7 @@ const projectPath = path.join(__dirname, '..', '..', 'client');
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/*', routes.authenticatedOrRedirect, function (req, res) {
|
app.get('/*', routes.authenticatedOrRedirect, function (req, res) {
|
||||||
res.sendFile(path.join(projectPath, 'public', 'index.html'));
|
res.sendFile(path.join(projectPath, 'dist', 'index.html'));
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(port, host, () => {
|
app.listen(port, host, () => {
|
||||||
|
|
|
||||||
|
|
@ -16,25 +16,14 @@ export default defineConfig({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
publicDir: "./public",
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
outDir: "./public",
|
outDir: "./dist",
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"~": path.join(__dirname, "src/"),
|
"~": path.join(__dirname, "src/"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
define: {
|
|
||||||
// global: {},
|
|
||||||
// process: {
|
|
||||||
// env: {
|
|
||||||
// VITE_APP_API: process?.env.VITE_APP_API || 'production',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// module.exports = {
|
|
||||||
// plugins: [require("tailwindcss")],
|
|
||||||
// };
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue