rollup / rollup-starter-lib

Bare-bones example of how to create a library using Rollup
MIT License
961 stars 230 forks source link

About update to @rollup/plugin-typescript #66

Closed GHLandy closed 2 years ago

GHLandy commented 4 years ago

Hello there, I want to upate to @rollup/plugin-typescript from rollup-plugin-typescript, but found it only compile main.ts but not the lunchtime.ts, millisecondsUntil.ts (as in this repo) in the cjs format.

I have look through https://rollupjs.org/guide but do not found anything to solve this.

So, I want to know if there is any special configuaration about this problem?

ash-r1 commented 4 years ago

I met the same problem.

It might be caused by this change: https://github.com/rollup/plugins/blob/master/packages/typescript/CHANGELOG.md#v300

Add note about old behaviour ( It mentions to https://github.com/rollup/plugins/pull/181 )

Does anyone know how to solve this ?

felix-kaestner commented 3 years ago

I think the issue seems to be related to how @rollup/plugin-typescript handles commonjs. If you switch the module option inside tsconfig.json to either es2015 or ESNext the problem disappears since typescript will inline the code instead of producing require statements. If someone can reproduce this, I think an issue should be opened at @rollup/plugin-typescript.