vue.config.js 680 B

12345678910111213141516171819
  1. const TransformPages = require('uni-read-pages')
  2. const { webpack } = new TransformPages()
  3. module.exports = {
  4. // productionSourceMap: false,
  5. lintOnSave: process.env.NODE_ENV === 'development',
  6. transpileDependencies: ['uview-ui', 'luch-request', '@dcloudio/uni-ui'], // 需要babel-loader转义的第三方依赖, 指定需要编译的依赖
  7. configureWebpack: {
  8. plugins: [
  9. new webpack.DefinePlugin({
  10. ROUTES: webpack.DefinePlugin.runtimeValue(() => {
  11. const tfPages = new TransformPages({
  12. includes: ['path', 'name', 'meta', 'aliasPath']
  13. })
  14. return JSON.stringify(tfPages.routes)
  15. }, true)
  16. })
  17. ]
  18. }
  19. }