vue.config.js 532 B

1234567891011121314151617
  1. //vue.config.js
  2. const TransformPages = require('uni-read-pages')
  3. const {webpack} = new TransformPages()
  4. module.exports = {
  5. configureWebpack: {
  6. plugins: [
  7. new webpack.DefinePlugin({
  8. ROUTES: webpack.DefinePlugin.runtimeValue(() => {
  9. const tfPages = new TransformPages({
  10. includes: ['path', 'name', 'aliasPath']
  11. });
  12. return JSON.stringify(tfPages.routes)
  13. }, true )
  14. })
  15. ]
  16. }
  17. }