theseanl / tscc

A collection of tools to seamlessly bundle, minify Typescript with Closure Compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rollup plugin bundles multiple modules into a single output file or doesn't bundle at all

foobardevpro opened this issue · comments

Hi.

I've made a simple demo that demonstrates two issues I've encountered:

  1. Rollup plugin doesn't bundle at all if an external is used.
  2. Rollup plugin bundles multiple modules into a single output file.

However, tscc cli / js api bundles properly in both cases.

https://github.com/foobardevpro/tscc-issues

There are several issues in action here.

  1. rollup watch does not produce any output
  • This is due to a build error, and you are supposed to use watch.on('event', (e) => { ... }) to catch and log build errors in case of watching. Without it, it seems that rollup does not notify about build failure in the console.
  • The build failure is caused by a presence of external modules, which is now fixed.
  1. rollup bundles 2 modules to a single chunk
  • This is caused by that I did not actually consider the case that two modules are declared as dependent in tscc.spec.json but does not actually share any codes.

Please test with 0.4.5!

Works!