vue.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. const path = require('path');
  2. const frameSrc = path.resolve(__dirname, '../admin-frame');
  3. module.exports = {
  4. // baseUrl: './',
  5. publicPath: './', //process.env.VUE_APP_ROOT_URL + 'cms'
  6. // pages: {
  7. // index: 'src/main.js',
  8. // },
  9. // transpileDependencies: ['naf-core'],
  10. configureWebpack: {
  11. externals: {
  12. 'element-ui': 'Element',
  13. vue: 'Vue',
  14. },
  15. resolve: {
  16. alias: {
  17. '@frame': frameSrc,
  18. '@naf': path.join(frameSrc, '/naf'),
  19. '@lib': path.join(frameSrc, '/lib'),
  20. },
  21. },
  22. },
  23. devServer: {
  24. port: 3004,
  25. disableHostCheck: true,
  26. before(app) {
  27. app.use((req, res, next) => {
  28. // eslint-disable-next-line no-console
  29. console.log(`[${req.method}]`, req.path);
  30. next();
  31. });
  32. },
  33. proxy: {
  34. '/platform/api': {
  35. // target: 'http://smart.localhost:8000',
  36. target: 'http://smart.cc-lotus.info',
  37. },
  38. '/files': {
  39. target: 'http://smart.cc-lotus.info',
  40. },
  41. '/ddapi': {
  42. target: 'http://smart.cc-lotus.info',
  43. // target: 'http://smart.localhost:8008',
  44. // pathRewrite: { '^/ddapi': '' },
  45. },
  46. '/adminapi': {
  47. target: 'http://10.16.5.15:8105', //http://10.16.5.15:8105// http://smart.cc-lotus.info
  48. // pathRewrite: { '^/ddapi': '' },
  49. },
  50. },
  51. },
  52. };