This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
import { mergeConfig, type UserConfig } from 'vite';
|
||||
|
||||
export default (config: UserConfig) => {
|
||||
// Important: always return the modified config
|
||||
return mergeConfig(config, {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': '/src',
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import { mergeConfig, type UserConfig } from "vite";
|
||||
|
||||
export default (config: UserConfig) => {
|
||||
// Read ALLOWED_HOSTS from environment and inject as VITE_ALLOWED_HOSTS
|
||||
const allowedHosts = process.env.ALLOWED_HOSTS || "localhost";
|
||||
|
||||
return mergeConfig(config, {
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": "/src",
|
||||
},
|
||||
},
|
||||
define: {
|
||||
"import.meta.env.VITE_ALLOWED_HOSTS": JSON.stringify(allowedHosts),
|
||||
},
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user