vue.config.js 795 B

1234567891011121314151617181920212223242526272829303132
  1. const path = require('path');
  2. const frameSrc = path.resolve(__dirname, '../admin-frame');
  3. const packageName = require('./package.json').name;
  4. console.log(path.join(frameSrc));
  5. module.exports = {
  6. devServer: {
  7. port: 3001,
  8. headers: {
  9. 'Access-Control-Allow-Origin': '*'
  10. },
  11. proxy: {
  12. '/api/': {
  13. target: 'http://192.168.0.45:18090'
  14. // target: 'http://127.0.0.1:18090'
  15. }
  16. }
  17. },
  18. configureWebpack: {
  19. output: {
  20. library: `${packageName}-[name]`,
  21. libraryTarget: 'umd',
  22. jsonpFunction: `webpackJsonp_${packageName}`
  23. },
  24. resolve: {
  25. alias: {
  26. '@components': path.join(frameSrc, '/src/components'),
  27. '@style': path.join(frameSrc, '/style'),
  28. '@lib': path.join(frameSrc, '/lib')
  29. }
  30. }
  31. }
  32. };