vue.config.js 388 B

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