flaunt-web/vite.config.js

36 lines
786 B
JavaScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import { batiaoPlugin } from '@batiao/batiao-sdk-vue-vite/onBuild'
import proxy from './src/proxy.cjs'
export default defineConfig({
plugins: [vue(), batiaoPlugin()],
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler'
}
}
},
resolve: {
alias: {
'@': resolve(__dirname, 'src')
}
},
build: {
chunkSizeWarningLimit: 2000,
rollupOptions: {
onwarn(warning, warn) {
if (warning.code === 'UNRESOLVED_IMPORT' || warning.code === 'UNUSED_EXTERNAL_IMPORT') return;
warn(warning);
}
}
},
server: {
//通过电脑ip访问设置
host: '0.0.0.0',
port: 3000,
proxy
}
})