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