TrySound / postcss-easy-import

PostCSS plugin to inline @import rules content with extra features
MIT License
201 stars 25 forks source link

glob resolver looks for files in modules #16

Closed marzelin closed 7 years ago

marzelin commented 7 years ago

For non-relative globs, glob resolver looks for files also in node_modules and web_modules

Closes #15

simonsmith commented 7 years ago

Thanks for this @marzelin.

What do you think about adding a unit test for this too?

marzelin commented 7 years ago

@simonsmith is there a way to test this behavior without pulling down some css library?

simonsmith commented 7 years ago

Yeah, if you test the resolveGlob function directly you can avoid all the postcss plugin stuff. Some of the existing tests should give you an idea - https://github.com/marzelin/postcss-easy-import/blob/7de8b90c0b6d5274653a0aa8a08320b83a5ba178/test/resolve-glob.js

Does that help?

TrySound commented 7 years ago

@marzelin You may just add node_modules dir in test fixtures

marzelin commented 7 years ago

Tests added, but they will break if you upgrade ava since they changed how the current working directory in test files is calculated.

simonsmith commented 7 years ago

Yeah, I had trouble upgrading ava before so I've left it for now. This looks good to me. @TrySound?

TrySound commented 7 years ago

Yep. lgtm I like jest now, if you don't want to use ava.

simonsmith commented 7 years ago

I like jest now, if you don't want to use ava

Same! Perhaps that can be a separate chore task

@marzelin Thanks very much for this! Merging.

simonsmith commented 7 years ago

Released in 2.1.0