Non working hmr

This commit is contained in:
SamTV12345 2024-07-16 22:00:50 +02:00
parent 70092c1cb7
commit d522de17e6
20 changed files with 2621 additions and 1185 deletions

View file

@ -1,10 +1,18 @@
// vite.config.js
import { resolve } from 'path'
import { defineConfig } from 'vite'
import vitePluginRequire from 'vite-plugin-require';
import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
export default defineConfig({
base: '/views/',
base: '/views/',
plugins: [
viteCommonjs(),
],
build: {
commonjsOptions:{
transformMixedEsModules: true,
},
outDir: resolve(__dirname, '../src/static/oidc'),
rollupOptions: {
input: {
@ -14,4 +22,31 @@ export default defineConfig({
},
emptyOutDir: true,
},
server:{
proxy:{
'/static':{
target: 'http://localhost:9001',
changeOrigin: true,
secure: false,
},
'/views/manifest.json':{
target: 'http://localhost:9001',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/views/, ''),
},
'/locales.json':{
target: 'http://localhost:9001',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/views/, ''),
},
'/locales':{
target: 'http://localhost:9001',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/views/, ''),
},
}
}
})