feat:初始化 -融骅
This commit is contained in:
55
front/vite.config.js
Normal file
55
front/vite.config.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import { createVuePlugin } from 'vite-plugin-vue2'
|
||||
import importerPlugin from 'vite-plugin-importer'
|
||||
|
||||
import path from 'path'
|
||||
|
||||
export default defineConfig({
|
||||
base: '',
|
||||
|
||||
plugins: [
|
||||
createVuePlugin({
|
||||
jsx: true,
|
||||
compilerOptions: {
|
||||
whitespace: 'condense'
|
||||
},
|
||||
jsxOptions: {
|
||||
compositionAPI: true
|
||||
}
|
||||
}),
|
||||
importerPlugin({
|
||||
libraryName: 'element-ui'
|
||||
})
|
||||
],
|
||||
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: '@import "./src/styles/variables.scss";',
|
||||
javascriptEnabled: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.join(__dirname, 'src'),
|
||||
'~': path.join(__dirname)
|
||||
},
|
||||
extensions: ['.js', '.vue']
|
||||
},
|
||||
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
},
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://0.0.0.0:3000',
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/api/, '')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user