vue.config.js 485 B

123456789101112131415161718
  1. const TransformPages = require('uni-read-pages');
  2. const { webpack } = new TransformPages();
  3. module.exports = {
  4. transpileDependencies: ['uview-ui'],
  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. };