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
Broken ansi-styles
produced by latest @rollup/plugin-commonjs
#4882
Comments
I have the same problem. Are there any temporary solutions? |
I created a file export default () => {}; And used alias({
entries: [
{find: 'chalk', replacement: './lib/chalk.js'},
]
}); Here is how it looks like: @putout/bundle. |
OK.thanks .I will try it |
I'm having the same issue (although mine is showing up in a vite build that relies on Does this workaround only work if |
I tried the reproduction but it did not seem to be broken for me. In any case from the described problems, rollup/plugins#1455 should fix this. I released a beta version for easier testing, could you please verify that the issue is resolved with @rollup/plugin-commonjs@24.1.0-0 ? |
Ah, the last commits in your reproduction add the fix discussed above. If I go back to before that commit, I can see the error and can confirm that the new plugin version would fix it. |
Rollup Version
3.17.3
Operating System (or Browser)
darwin
Node Version (if applicable)
18
Link To Reproduction
To reproduce you can clone the repository: https://github.com/putoutjs/bundle, update
@rollup/plugin-common
to latest version, thennpm install && npm run build && node bundle/putout.js
will produce an error (there is no error in@rollup/plugin-common
v22)Expected Behaviour
I'm using
chalk
, and it has dependencyansi-styles
, it works good with@rollup/plugin-commonjs@22
, but I have issues using@rollup/plugin-commonjs@23
(same with v24) it converts the code to something like this (simplified a bit):So
ansiStylesExports
never assigned so it is an empty object.In opposite
@rollup/plugin-commonjs@22
produces next code (simplified):Maybe I missing something in configuration, could you please help me with this?
I use
chalk@4
because I need a Yarn Berry support and deduplication.Actual Behaviour
ansy-styles
produces in@rollup/plugin-commonjs@24
in the same way as it was in@rollup/plugin-commonjs@22
.Related to rollup/plugins#1446
The text was updated successfully, but these errors were encountered: