vue.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. var path = require('path')
  2. function resolve (dir) {
  3. return path.join(__dirname, dir)
  4. }
  5. module.exports = {
  6. // 输出文件目录
  7. outputDir: '../../bmclinxupro/app/goahead-3.6.5/src/web',
  8. devServer: {
  9. host: '127.0.0.1',
  10. port: 9999,
  11. proxy: {
  12. '/action': {
  13. target: 'http://192.168.1.121/',
  14. ws: true,
  15. changeOrigin: true,
  16. },
  17. }
  18. },
  19. productionSourceMap: false,
  20. assetsDir:'static',
  21. chainWebpack: (config) => {
  22. config.resolve.alias
  23. .set('@', resolve('src'))
  24. .set('assets', resolve('src/assets'))
  25. .set('components', resolve('src/components'))
  26. if (process.env.NODE_ENV === 'production') {
  27. // 清除css,js版本号
  28. config.output.filename('static/js/[name].js').end();
  29. config.output.chunkFilename('static/js/[name].js').end();
  30. // 为生产环境修改配置...
  31. config.plugin('extract-css').tap(args => [{
  32. filename: `static/css/[name].css`,
  33. chunkFilename: `static/css/[name].css`
  34. }])
  35. }
  36. },
  37. lintOnSave: false
  38. }