New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostCSS plugin not invoked for assets loaded from node_modules/ #5551
Comments
When searching for config files (Babel, Postcss, ....), we stop once parcel/packages/transformers/postcss/src/loadConfig.js Lines 71 to 74 in 67aefd8
parcel/packages/core/utils/src/config.js Lines 28 to 31 in 67aefd8
So leaflet isn't even processed with your config file. Same applies to babelrc: files from node_modules aren't processed with your project's Babel config. |
Thanks, that's clearer now (I wasn't really sure where to look previously). What I really want to do is load the (preprocessed) CSS from my own Edit: the CSS is being minified by Parcel ( |
At the moment no. We are no opposed to feature, but it should be opt in (so you'd somehow specify "yes, do apply my postcssrc to
The final bundle is minified, not the individual input assets. For optimizers/packagers, the config is read relative to the bundle output path. |
Hope to deal with it soon,file for node_modules not working when using postcss-pxtorem |
🐛 bug report
🎛 Configuration (.babelrc, package.json, cli command)
package.json
index.html
🤔 Expected Behavior
postcss-image-inliner
should be invoked on both css files.😯 Current Behavior
postcss-image-inliner
is not invoked on the leaflet css. Note that the"strict": true
config passed topostcss-image-inliner
should make it fail if the assets can't be found, but theassetPaths
config is not the issue -- the plugin code is never called (confirmed by littering thepostcss-image-inliner
js withconsole.log
statements. It's invoked forstyles.css
but not for the leaflet css).💁 Possible Solution
The same assets compile as expected if they're simply copied out of
node_modules
, so is there something that's explicitly preventingnode_modules/**/*.css
being processed?🔦 Context
I'm writing some native web components, and I want to bundle all the needed assets into a single
.js
file, so I want to useimport leafletStyles from "bundle-text:leaflet/dist/leaflet.css";
and write theleafletStyles
into my component'sshadowDom
. But this problem surfaces even in with an html entrypoint and css included with<link>
tags.💻 Code Sample
https://github.com/simonwiles/parcel-postcss-image-inliner-example
🌍 Your Environment
The text was updated successfully, but these errors were encountered: