Search code examples
reactjscss-modulesreact-css-modulesnwb

How to configure CSS Mdoules with NWB on sass files


I am creating a react component with NWB. The folder structure looks like below.

* components/
** src/
*** Component1/
**** index.js
**** index.module.scss
*** Component2/
** nwb.config.js
** package.json

How can I implement CSS modules in this structure? The problem is, style files not exporting to es (build, dist etc.) folder.


Solution

  • I fixed this issue by editing the build script on package.json.

    "scripts": {
        "build": "nwb build-react-component --copy-files"
    }