Closed toomuchdesign closed 7 years ago
Hi @TrySound, back to this feature:
I'm thinking to use a helper like is-glob to switch between glob and module resolves.
Under the hoods is-glob
tests a regex against a string. This additional operation might have a little cost in terms of performances, but we might keep this feature optional and avoid breaking changes.
Please tell me you'd like me to work on a pull request. Cheers!
@toomuchdesign Definitely would appreciate this feature. :+1:
The feature is almost ready!
@TrySound. I noticed that resolve modules tests are disabled by a test.only
assertion. Is it intentional, or I can let the runner trigger the whole set of tests? On my machine tests are all ok.
Pull request done. I'm available for any further consideration. Greetings!
👍
Please notice that, aside this feature, postcss-easy-import v1 wraps postcss-import v.8 which is currently unreliable due to this bug. So, beside this pull request, there is still to decide if switching back to postcss-import v.7 or waiting for a patch.
I'm curious why the behavior was made mutually exclusive in the first place.. hiding it behind this option is pretty confusing. Is it really that slow to test each import?
I added the feauture as an option to not introduce a breaking change. If you consider a big project with hundreds of imports to be re-evaluated on each ctrl+s, even a small delay might be worth of consideration! Furthermore this feature is almost useless in a webpack-like based project.
The long standing import bugs in 8.x
of postcss-import
have been fixed.
Hi @TrySound , thanks for your great plugin! I have a question about the opportunity of a new feature. Do you think would it be possibile to extend
@import
resolution and make it accept both module lookup and glob imports at same time?In my case I have a project where I'd like to import some CSS with a standard modules
@import
tree and some others CSS picking the files up with a**/*.css
globbing style into a specific folder.Any advice would be greatly appreciated.
Andrea