42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
const path = require('path')
|
||
const AutoImport = require('unplugin-auto-import/webpack')
|
||
const Components = require('unplugin-vue-components/webpack')
|
||
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
|
||
const { defineConfig } = require('@vue/cli-service')
|
||
const { DefinePlugin } = require('webpack')
|
||
const { execSync } = require('child_process')
|
||
|
||
const commitInfo = execSync('git show -s --format=%cs(%h)').toString().trim()
|
||
|
||
module.exports = defineConfig({
|
||
publicPath: './',
|
||
transpileDependencies: true,
|
||
productionSourceMap: false,
|
||
configureWebpack: {
|
||
resolve: {
|
||
alias: { '@': path.resolve(__dirname, './src') }
|
||
},
|
||
plugins: [
|
||
AutoImport({
|
||
resolvers: [ElementPlusResolver()],
|
||
}),
|
||
Components({
|
||
resolvers: [ElementPlusResolver()],
|
||
}),
|
||
new DefinePlugin({
|
||
'process.env.VERSION': `'${commitInfo}'`
|
||
})
|
||
]
|
||
},
|
||
devServer: {
|
||
port: 8080,
|
||
proxy: {
|
||
'^/api': {
|
||
// target: 'http://localhost:3301'
|
||
target: 'https://www.colorfulsweet.site',
|
||
changeOrigin: true
|
||
}
|
||
}
|
||
}
|
||
})
|