vue.config.js 867 B

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