vue.config.js 945 B

1234567891011121314151617181920212223242526272829303132333435
  1. module.exports = {
  2. // 输出文件目录
  3. outputDir: '../../linuxproject/src/web/',
  4. devServer: {
  5. host: '127.0.0.1',
  6. port: 9999,
  7. proxy: {
  8. '/action': {
  9. target: 'http://192.168.1.149/',
  10. ws: true,
  11. changeOrigin: true,
  12. },
  13. }
  14. },
  15. productionSourceMap: false,
  16. assetsDir:'static',
  17. chainWebpack: config => {
  18. if (process.env.NODE_ENV === 'production') {
  19. // 清除css,js版本号
  20. config.output.filename('static/js/[name].js').end();
  21. config.output.chunkFilename('static/js/[name].js').end();
  22. // 为生产环境修改配置...
  23. config.plugin('extract-css').tap(args => [{
  24. filename: `static/css/[name].css`,
  25. chunkFilename: `static/css/[name].css`
  26. }])
  27. }
  28. },
  29. lintOnSave: false
  30. }