vue.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. const env = require('./src/config/env');
  2. const env_url = env.env_url;
  3. const Timestamp = new Date().getTime();
  4. module.exports = {
  5. publicPath: './',
  6. devServer: {
  7. proxy: {
  8. '/api': {
  9. // target:"http://8.136.230.133:8080",//这里设置你要访问的域名(或IP+端口) //测试
  10. //target:"http://8.140.188.129:8080",//这里设置你要访问的域名(或IP+端口) //线上
  11. //target:"http://192.168.2.122:8080",//这里设置你要访问的域名(或IP+端口)
  12. target: env_url,
  13. changeOrigin: true,
  14. pathRewrite: {
  15. '^/api': '/'
  16. }
  17. }
  18. }
  19. },
  20. outputDir: process.env.NODE_ENV === "development" ? 'devDist' : 'dist',
  21. transpileDependencies: ['wangeditor','cache-loader','vuejs-datepicker'],
  22. configureWebpack: { // webpack 配置
  23. entry: ['babel-polyfill', './src/main.js'],
  24. output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】
  25. filename: `js/[name].${Timestamp}.js`,
  26. chunkFilename: `js/chunk-vendors.${Timestamp}.js`
  27. },
  28. },
  29. };