-
Notifications
You must be signed in to change notification settings - Fork 507
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
UMD format with lodash breaks due to lodash-es substitution #759
Comments
Ah yep, that's probably required for UMD. Currently the code only checks for CJS. Should be a one-liner fix here: https://github.com/formium/tsdx/blob/8b148cea34c1852f6fcf6e94a3758d7a9f46d9b2/src/babelPluginTsdx.ts#L72 EDIT: actually I'm not so sure this isn't due to an upstream bug. |
How do I disable this feature ? |
@Morphexe not sure what you mean, this is a bug, not a feature. I think one can do a partial workaround for this by configuring module.exports = {
// ...
plugins: [
// ...
['babel-plugin-transform-rename-import', { replacements: [{ original: '', replacement: '' }] }]
]
} But conversely, that'll probably break ESM builds |
So #912 (comment) revealed a similar issue that points to upstream rollup/plugins#304 which would seem to confirm my suspicion that there's a bug upstream. Per my comment there:
Will have to add a test for this in v0.15.0 to ensure it works after the upgrade. |
Can you post a working example please? The snippet syntax looks borked... |
@axedre ah looks like it was missing a closing bracket, I updated my comment |
That still doesn't look like valid javascript. For anyone else stumbling on this, check out: https://www.npmjs.com/package/babel-plugin-transform-rename-import. |
Current Behavior
To export umd module, I would like to include all modules into the bundle, so I config the rollup
but when building, it crashes:
Expected behavior
Suggested solution(s)
when building umd module, it should not rename lodash to lodash-es
Additional context
Your environment
The text was updated successfully, but these errors were encountered: