vue.config.js 里面的配置,如果更新到vue3 vite 项目中,配置要怎么改呢?

vue.config.js 里面的配置,如果更新到vue3 vite 项目中,配置要怎么改呢?

// file: vue.config.js
module.exports = {
  configureWebpack: config => {
    Object.assign(config.resolve, {
      alias: {
        // 加上对
        'dashPackages': resolve('node_modules/@gcpaas/dash-board-ui/packages'),
      }
    })
  },
  chainWebpack: config => {
        config.module
          .rule('svg')
          .exclude
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/assets/images/dataSourceIcon/svg'))
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/assets/images/pageIcon/svg'))
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/assets/images/appPrependIcon/svg'))
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/assets/images/bigScreenIcon/svg'))
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/Svgs/svg'))
          .end()
        config.module
          .rule('icons')
          .test(/\.svg$/)
          .include
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/assets/images/dataSourceIcon/svg'))
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/assets/images/pageIcon/svg'))
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/assets/images/appPrependIcon/svg'))
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/assets/images/bigScreenIcon/svg'))
          .add(resolve('./node_modules/@gcpaas/dash-board-ui/packages/Svgs/svg'))
          .end()
          .use('svg-sprite-loader')
          .loader('svg-sprite-loader')
          .options({
            symbolId: 'icon-[name]'
          })
          .end()
  },
  transpileDependencies: [
   '@gcpaas/dash-board-ui'
  ]
}

vue.config.js 里面的配置,如果更新到vue3 vite 项目中,配置要怎么改呢?

阅读 636
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题