35 lines
687 B
JavaScript
35 lines
687 B
JavaScript
import {
|
|
defineConfig
|
|
} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
const path = require('path')
|
|
import { resolve } from 'path' // 主要用于alias文件路径别名
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
// 在文件中添加以下内容
|
|
server: {
|
|
host: '0.0.0.0'
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, '.', 'src'),
|
|
},
|
|
},
|
|
plugins: [vue()],
|
|
|
|
// 选项...
|
|
chainWebpack: config => {
|
|
config.module
|
|
.rule('swf')
|
|
.test(/\.swf$/)
|
|
.use('url-loader')
|
|
.loader('url-loader')
|
|
.tap(options => {
|
|
return {
|
|
limit: 10000
|
|
}
|
|
})
|
|
}
|
|
})
|