iview-admin/vue.config.js

20 lines
502 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const path = require('path')
const fs = require('fs')
const resolve = dir => {
return path.join(__dirname, dir)
}
const env = process.env.NODE_ENV
fs.writeFileSync(path.join(__dirname, './config/env.js'), `export default '${env}'
`)
module.exports = {
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'))
.set('_conf', resolve('config'))
}
}