Skip to content

Commit

Permalink
feat: add basepath
Browse files Browse the repository at this point in the history
  • Loading branch information
Melisa Anabella Rossi committed Dec 12, 2023
1 parent af17b0d commit f88bbed
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"include": ["src", "vite.config.ts"],
"references": [{ "path": "./tsconfig.node.json" }]
}
27 changes: 23 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()]
})
export default defineConfig(({ command }) => ({
plugins: [react()],
...(command === 'build'
? {
base: '/profile',
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: 'globalThis'
}
},
build: {
commonjsOptions: {
transformMixedEsModules: true
},
sourcemap: true
}
}
}
: undefined)
}))

0 comments on commit f88bbed

Please sign in to comment.