vue.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. const { defineConfig } = require('@vue/cli-service')
  2. const baseUrl = require('./src/utils/baseUrl.js')
  3. const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
  4. module.exports = defineConfig({
  5. transpileDependencies: true,
  6. lintOnSave: false,
  7. // baseUrl: BASE_URL,
  8. // chainWebpack: config => {
  9. // config.resolve.alias
  10. // .set('@', resolve('src'))
  11. // .set('_c', resolve('src/components'))
  12. // .set('_conf', resolve('config'))
  13. // },
  14. publicPath: '/',
  15. configureWebpack: {
  16. externals: {
  17. 'fs': require('fs')
  18. },
  19. plugins: [
  20. new MonacoWebpackPlugin()
  21. ]
  22. },
  23. devServer: {
  24. port: 8080,
  25. proxy: process.env.NODE_ENV === "development" ? {
  26. [baseUrl.ROOT]: {
  27. target: baseUrl.URL,
  28. // target: 'http://192.168.2.4:8086',
  29. changeOrigin: true,
  30. ws: false,
  31. pathRewrite: {
  32. // '^/api': ''
  33. [`^${baseUrl.ROOT}`]: ''
  34. }
  35. },
  36. } : baseUrl.ROOT
  37. }
  38. })