Skip to content

有没有大佬遇到过这个问题 :项目run运行正常 但是vue build报错 使用版本node18.16.1+vite4.5.0+antv/g6: 4.8.21 #5720

Closed Answered by pikachuWorld
pikachuWorld asked this question in Q&A
Discussion options

You must be logged in to vote

问题已经解决了, commonjs()顺序问题,必须放到最上面

import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';

vite.config.ts
.....
plugins: [
commonjs(),
vue(),
progress(),
visualizer({
// 打包后自动打开分析报告
open: true,
}),

    requireTransform({ fileRegex: /.js$|.ts$|vue$/ }), 
    nodeResolve({
        browser: true,
    }),
],

......

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hustcc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant