rollup-plugin-ts
rollup-plugin-ts copied to clipboard
Unexpected import when bundling UMD, broken sourcemap
- Version: 3.2.0
- Rollup Version: 3.17.2
- Operating System and version (if applicable): Windows 10 22H2, Build 19045
- Node Version (if applicable): 19.6.0, also tried with 18.14.2
- Does it work with
tsc(if applicable): Yes
Reproduction
https://github.com/decanTyme/chartjs-plugin-tailwindcss-colors/tree/rollup-migrate
- Install deps and run
build, should output adist/plugin.umd.jsfine with no warnings - Go to
rollup.config.mjsand changetypescript2totypescript(there's also some comments there btw) - Observe warnings about a
utilimport, a broken sourcemap, and a missing global (which is, again, the rogueutil) - Optionally, compare both generated bundles, should contain a
utilimport somewhere, which is actually an import ofutil-deprecate:
// dist/plugin.umd.js
/**
* For Node.js, simply re-export the core `util.deprecate` function.
*/
var node = require$$0.deprecate; // ??

Expected Behavior
... albeit using rollup-plugin-typescript2, but it is just used for transpiling anyway
Actual Behavior

This is kinda blocking me from using Rollup but TBH, I don't even know which one should be the right ouput. Would really appreciate some insights here tho! 🙂 I would like to keep using rollup-plugin-ts, it fits my needs perfectly, many thanks for this plugin!