ro-savage / react-scripts-cssmodules

Enable CSS Modules for Create-React-App using the official CRA api
https://www.npmjs.com/package/react-scripts-cssmodules
47 stars 5 forks source link

asset-manifest.json only contains one main.css file #7

Closed jpstevens closed 5 years ago

jpstevens commented 6 years ago

When using something like the following:

import './App.css'; // regular CSS import
import s from './test.module.css'; // CSS module

The asset manifest comes out like so:

{
  "main.css": "static/css/main-cssmodules.29f7c281.css",
  "main.css.map": "static/css/main-cssmodules.29f7c281.css.map",
  "main.js": "static/js/main.009f56a3.js",
  "main.js.map": "static/js/main.009f56a3.js.map",
  "static/media/logo.svg": "static/media/logo.5d5d9eef.svg"
}

It's missing the entry for main.c17080f1.css and main.c17080f1.min.css.

Any ideas why?

ro-savage commented 6 years ago

Unfortunately I don't have the answer.

The ManifestPlugin should be auto generating it based on all the files created during the webpack build (I believe it looks at compilation.getStats() from webpacks build process).

It should therefore pick it up. I might be an issue upstream, as we shouldn't need to change anything.

Happy for someone to take a look and investigate.

berdyshev commented 6 years ago

I'm experiencing the same issue

ro-savage commented 5 years ago

Closing this, as it is currently not being actioned.

If anyone knows why this happens, feel free to submit a PR.