Skip to content

Commit

Permalink
Update vite.config.js with base path for serving the app
Browse files Browse the repository at this point in the history
  • Loading branch information
SaiBarathR committed Dec 20, 2023
1 parent 625d656 commit 206d896
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ import svgr from "vite-plugin-svgr";
import reactRefresh from 'vite-plugin-react-refresh';
import eslint from 'vite-plugin-eslint';

export default defineConfig({
plugins: [react(), reactRefresh(), svgr(), eslint()],
server: {
host: true,
strictPort: true,
port: 3000
},
define: {
global: 'window',
},
build: {
outDir: "build"
},
base: '/',
export default defineConfig(({ command }) => {
const config = {
plugins: [react(), reactRefresh(), svgr(), eslint()],
server: {
host: true,
strictPort: true,
port: 3000
},
define: {
global: 'window',
},
build: {
outDir: "build"
},
base: '/manga-harbor/'
}
if (command === 'serve') {
config.base = '/'
}
return config
})

0 comments on commit 206d896

Please sign in to comment.