Rollupjs不会捆绑所有文件

问题描述

我在打字稿项目中使用汇总来捆绑。当我在tsconfig中使用"module": "commonjs"时,汇总输出仅包含inputrollup.config.js中指定的文件的内部。但是,当我将tsconfig模块更改为esnextes2015时,一切似乎都可以正常工作。但是我也使用lerna monorepo,所以切换到不同的模块会弄乱我从不同包中的导入。有没有一种方法可以在不切换模块的情况下完成汇总工作,或者我应该在项目中重写一些代码?预先感谢!

这是我的rollup.config.js的一部分:

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

export default {
  input: {
    'src/index': 'src/index.ts','src/tests': 'src/tests.ts',},external: ['chalk'],output: {
    dir: 'lib',format: 'cjs',freeze: false,interop: false,sourcemap: false,chunkFileNames: '[name].js',plugins: [
    nodeResolve(),typescript(),commonjs({include: '../../node_modules/**})
  ],};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)