- Prefer to resolve by modifying the source code; remember to restart after modification, some dependencies may need reprocessing.
- Alternatively, use pre-bundling or CommonJS plugins to handle it.
To solve this problem, I briefly tried several CommonJS plugins found through search, and finally chose @rollup/plugin-commonjs based on considerations of maturity, reliability, and comprehensiveness.
import commonjs from '@rollup/plugin-commonjs';https://juejin.cn/post/7017446703296937998export default defineConfig({ plugins: [ commonjs({ transformMixedEsModules: true, include: ['path/to/xxx.js'], }), ], });
暂无评论。