akanix42 / meteor-css-modules

MIT License
92 stars 19 forks source link

building stuck for infinity #100

Closed wojtkowiak closed 7 years ago

wojtkowiak commented 7 years ago

Repro:

git clone https://github.com/wojtkowiak/tbsengine
git checkout 36a74db9119c253cfd09d41b97bfc7bf210604c0

I have a one main.scss in which I am import scss from other package:

@import '~@blueprintjs/core/dist/variables.scss';

When I remove this import build is working. When I paste the contents of that file to main.scss it also works. But when I add this import building css-modules seems to be stuck. I have left it for 40 minutes and nothing happend. It's just stuck on:

=> Started proxy.
   Building for web.browser                  |

The | spinner does not even spin ;)

wojtkowiak commented 7 years ago

Did you have any moment to look at it?

akanix42 commented 7 years ago

I've done a little digging. So far I've determined that it's freezing after importing that file... which of course we already knew. I'll try to take a further look tomorrow.

akanix42 commented 7 years ago

Got it! You have two options:

  1. Adjust your CSS modules settings in package.json to not ignore the blueprint files: old:
    "ignorePaths": [
      "node_modules"
    ],

    new:

    "ignorePaths": [
      "node_modules\/(?!@blueprintjs\/core\/dist)"
    ],
  2. Update to nathantreid:css-modules@2.5.4-beta.3, which includes 2 fixes for the issue you experienced (one fixing the freezing, the other adjusting the logic so it won't even go down that path anymore in situations like this). The configuration you're using causes all files under node_modules to be ignored, so the plugin had to manually load the file from disk instead of retrieving from Meteor. There was a bug in the disk retrieval causing it to freeze. I also made the plugin a bit smarter, so if Meteor has already loaded the file, it will use that version when importing the file instead of loading it from disk.
akanix42 commented 7 years ago

This was fixed in the 2.5.4 release.

wojtkowiak commented 7 years ago

@nathantreid big kudos for you. I just checked it last evening and it works correctly now. Huge thanks for your time!