vue.config.js 614 B

1234567891011121314151617181920212223242526272829303132
  1. //vue.config.js
  2. const TransformPages = require('uni-read-pages')
  3. const {
  4. webpack
  5. } = new TransformPages()
  6. module.exports = {
  7. devServer: {
  8. disableHostCheck: true,
  9. proxy: {
  10. "/api": {
  11. target: "https://b.925i.cn",
  12. changeOrigin: true,
  13. secure: true,
  14. pathRewrite: {
  15. "^/api": ""
  16. }
  17. }
  18. }
  19. },
  20. configureWebpack: {
  21. plugins: [
  22. new webpack.DefinePlugin({
  23. ROUTES: webpack.DefinePlugin.runtimeValue(() => {
  24. const tfPages = new TransformPages({
  25. includes: ['path', 'name', 'aliasPath', "meta"]
  26. });
  27. return JSON.stringify(tfPages.routes)
  28. }, true)
  29. })
  30. ]
  31. }
  32. }