Skip to content

Commit

Permalink
chore: allow dev server to be run outside of ynh-dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
Axolotle committed Dec 19, 2024
1 parent 814b22b commit 3604275
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,22 @@ export default defineConfig(({ mode }) => {
return {
...config,
server: {
port: 8080,
host: env.VITE_IP,
https: {
// Use already created cert from yunohost instance
key: fs.readFileSync('/etc/yunohost/certs/yunohost.org/key.pem'),
cert: fs.readFileSync('/etc/yunohost/certs/yunohost.org/crt.pem'),
},
fs: {
// Needed for special ynh-dev context where node_modules is symlinked
allow: [
'/ynh-dev/yunohost-admin/app',
'/var/cache/ynh-dev/yunohost-admin/node_modules',
],
},
...(env.VITE_LOCAL === 'true' ? {} : {
port: 8080,
host: env.VITE_IP,
https: {
// Use already created cert from yunohost instance
key: fs.readFileSync('/etc/yunohost/certs/yunohost.org/key.pem'),
cert: fs.readFileSync('/etc/yunohost/certs/yunohost.org/crt.pem'),
},
fs: {
// Needed for special ynh-dev context where node_modules is symlinked
allow: [
'/ynh-dev/yunohost-admin/app',
'/var/cache/ynh-dev/yunohost-admin/node_modules',
],
},
}),
proxy: {
'/yunohost': {
target: `https://${env.VITE_IP}`,
Expand Down

0 comments on commit 3604275

Please sign in to comment.