Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected import when bundling UMD, broken sourcemap #204

Open
decanTyme opened this issue Feb 25, 2023 · 0 comments
Open

Unexpected import when bundling UMD, broken sourcemap #204

decanTyme opened this issue Feb 25, 2023 · 0 comments

Comments

@decanTyme
Copy link

  • 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

  1. Install deps and run build, should output a dist/plugin.umd.js fine with no warnings
  2. Go to rollup.config.mjs and change typescript2 to typescript (there's also some comments there btw)
  3. Observe warnings about a util import, a broken sourcemap, and a missing global (which is, again, the rogue util)
  4. Optionally, compare both generated bundles, should contain a util import somewhere, which is actually an import of util-deprecate:
// dist/plugin.umd.js

/**
 * For Node.js, simply re-export the core `util.deprecate` function.
 */

var node = require$$0.deprecate; // ??

image

Expected Behavior

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

Actual Behavior

image

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant