Skip to content

Commit

Permalink
change vite config and index.html for relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
worldvisualizer committed Nov 27, 2024
1 parent 3563ed0 commit e12aee8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
7 changes: 0 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,5 @@
<body>
<div id="root"></div>
<script type="module" src="./src/main.tsx"></script>
<script>
console.log('HTML loaded')
window.addEventListener('load', () => {
console.log('Window loaded')
console.log('Root element:', document.getElementById('root'))
})
</script>
</body>
</html>
19 changes: 6 additions & 13 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,18 @@ import path from 'path'
export default defineConfig({
plugins: [react()],
base: '/yurim_fe_portfolio/',
server: {
port: 3000,
open: true,
},
preview: {
port: 3000,
open: true,
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
build: {
outDir: 'dist',
sourcemap: true,
assetsDir: 'assets',
rollupOptions: {
input: {
main: path.resolve(__dirname, 'index.html')
},
output: {
assetFileNames: 'assets/[name].[hash][extname]',
chunkFileNames: 'assets/[name].[hash].js',
entryFileNames: 'assets/[name].[hash].js'
}
}
}
Expand Down

0 comments on commit e12aee8

Please sign in to comment.