init
This commit is contained in:
48
app/internal/view/front/vite.config.ts
Normal file
48
app/internal/view/front/vite.config.ts
Normal file
@ -0,0 +1,48 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import path from 'node:path'
|
||||
|
||||
export default defineConfig({
|
||||
base: '/public/',
|
||||
publicDir: false,
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
|
||||
build: {
|
||||
outDir: 'public',
|
||||
emptyOutDir: false,
|
||||
cssCodeSplit: false,
|
||||
|
||||
rollupOptions: {
|
||||
input: {
|
||||
app: path.resolve(__dirname, 'src/index.ts'),
|
||||
style: path.resolve(__dirname, 'src/index.css'),
|
||||
},
|
||||
output: {
|
||||
entryFileNames: 'index.js',
|
||||
assetFileNames: (assetInfo) => {
|
||||
const name = assetInfo.name ?? ''
|
||||
|
||||
if (name.endsWith('.css')) {
|
||||
return 'index.css'
|
||||
}
|
||||
|
||||
if (/\.(woff|woff2|eot|ttf|otf)$/i.test(name)) {
|
||||
return 'fonts/[name][extname]'
|
||||
}
|
||||
|
||||
return '[name][extname]'
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 3000,
|
||||
allowedHosts: true,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user