vue.config.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. const webpack = require('webpack')
  2. const packageName = 'qmxSubApp'
  3. module.exports = {
  4. publicPath: '/qmx_page_admin',
  5. outputDir: "qmx_page_admin",
  6. productionSourceMap: false,
  7. lintOnSave: false,
  8. css: {
  9. loaderOptions: {
  10. sass: {
  11. // 静默 `legacy-js-api` 和 `@import` 警告
  12. sassOptions: {
  13. silenceDeprecations: ['legacy-js-api', 'import', 'global-builtin']
  14. },
  15. prependData: `@import '@/assets/css/_variables.scss';`
  16. }
  17. }
  18. },
  19. configureWebpack: {
  20. // devtool: 'source-map',
  21. output: {
  22. library: 'qmxSubApp',
  23. libraryTarget: 'umd',
  24. jsonpFunction: `webpackJsonp_${packageName}`
  25. },
  26. plugins: [
  27. new webpack.ProvidePlugin({
  28. $:"jquery",
  29. jQuery:"jquery",
  30. "windows.jQuery":"jquery"
  31. })
  32. ]
  33. },
  34. chainWebpack: (config) => {
  35. config.module.rule('fonts').use('url-loader').loader('url-loader').options({}).end();
  36. },
  37. devServer: {
  38. // open: false,
  39. // client: {
  40. // overlay: {
  41. // errors: true,
  42. // warnings: false
  43. // }
  44. // },
  45. // // historyApiFallback: true,
  46. // allowedHosts: 'all',
  47. proxy: {
  48. '^/dev-api': {
  49. target: 'https://web2-qmx_admin.jydev.jianyu360.com',
  50. changeOrigin: true,
  51. ws: false,
  52. logLevel: 'debug',
  53. pathRewrite: {
  54. '^/dev-api': '/api/admin/'
  55. }
  56. },
  57. '^/filemanage': {
  58. target: 'https://web2-qmx_admin.jydev.jianyu360.com',
  59. changeOrigin: true,
  60. ws: false,
  61. logLevel: 'debug',
  62. pathRewrite: {
  63. '^/filemanage': '/filemanage'
  64. }
  65. },
  66. '^/jyOrderManager': {
  67. target: 'https://jybx2-webtest.jydev.jianyu360.com',
  68. changeOrigin: true,
  69. ws: false,
  70. logLevel: 'debug',
  71. },
  72. '^/succbi': {
  73. target: 'https://web2-qmx_admin.jydev.jianyu360.com',
  74. changeOrigin: true,
  75. ws: false,
  76. logLevel: 'debug'
  77. }
  78. }
  79. }
  80. }