webpack: New option for postcss introducing import bug
Hello,
'postcss-import': {},
was added to .postcssrc.js
in last release.
Currently this option is failing build using ~
import in sass files for me.
I have one stylesheet with an import like : @import "~flatpickr/dist/flatpickr.css"
.
With 'postcss-import': {},
set, an error is thrown :
Module build failed: Error: Failed to find '~flatpickr/dist/flatpickr.css'
Without it, everything is fine.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (9 by maintainers)
I ran into this same problem yesterday and the issue is because
vue-loader
uses PostCSS directly instead of relying onpostcss-loader
sass-loader
skips any imports for paths that end with.css
I was able to workaround the issue by omitting the file extension in the import statement
@robbiemu For me, this does work:
But this fails:
A temporal solution for me was importing main SCSS files in main.js, instead of SASS @import, like this
And it works like a charm 😉