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

Import colorjoe using 'import' keyword #54

Open
foregrow opened this issue May 27, 2022 · 1 comment
Open

Import colorjoe using 'import' keyword #54

foregrow opened this issue May 27, 2022 · 1 comment

Comments

@foregrow
Copy link

foregrow commented May 27, 2022

Is it possible to import colorjoe using 'import' keyword?

I tried importing its all contents using:
import * as colorjoe from 'colorjoe';
and as default:
import colorjoe from 'colorjoe';
but it did not work

Actually I get TypeError: Cannot set properties of undefined (setting 'colorjoe')

@bebraw
Copy link
Owner

bebraw commented May 27, 2022

Can you provide a simple reproduction (i.e. with Node version etc.)?

I think the problem is that the library was written before ES2018 existed and it has been packaged within a UMD wrapper. To solve, we would have to extend rollup configuration and likely leverage the module field.

A PR would be highly welcome as I don't maintain the package actively anymore and many options have showed up. If I was writing it now, likely I would do composition differently etc. although the core idea of using CSS for gradients is solid.

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

2 participants