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

css modules support #417

Open
hnrchrdl opened this issue Sep 24, 2021 · 1 comment
Open

css modules support #417

hnrchrdl opened this issue Sep 24, 2021 · 1 comment

Comments

@hnrchrdl
Copy link

I try to use preconstruct with css modules. So inside the components, i write e.g. const styles = import './styles.css';, which should give me an object with the classnames from the stylesheet as properties that can be used in the component.

To make it work, I have tried to use babel-plugin-css-modules-transform. From babel.config.js:

plugins: [
  [
    'css-modules-transform',
    {
      extensions: ['.css'],
    },
  ]
]
...

But when running yarn preconstruct build i get the error Unexpected token (Note that you need plugins to import files that are not JavaScript), so it seems the css is not correctly transformed.

Anything I am missing? Is it possible to use css modules with this package at all?

@mtzfactory
Copy link

i'm having the same problem

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