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

Use default export instead of export = styles #94

Open
ddanielbee opened this issue Jun 2, 2020 · 1 comment
Open

Use default export instead of export = styles #94

ddanielbee opened this issue Jun 2, 2020 · 1 comment

Comments

@ddanielbee
Copy link

Situation

I'm currently using typed-css-modules to generate css-modules types in a snowpack project that uses @babel/plugin-transform-typescript under the hood.

Problem

When building, I get the following error:

`export =` is not supported by @babel/plugin-transform-typescript
  Please consider using `export <value>;`.

Solution

To solve this issue, we can change this line:

'export = styles;',

To 'export default styles;',

I'll work on a PR for it, but in the meantime, do you see any issues with this approach?

@drwpow-figma
Copy link

I think the named exports (#100) is actually a better solution than default export. The problem with exporting an object is that object will persist in the final bundle, and across a large enough app it does have a significant impact in bundle size (maybe not a performance concern, but certainly impacts bytes over the wire and memory). import * from styles is 99/100 the more efficient packaging method.

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