You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've configured and am using postcss-smart-import to help with my CSS imports. This works beautifully with both the dev and build scripts defined in the package.json however when I attempt to run the unit script it fails and complains about modules not being resolved.
The error is several iterations of this:
ERROR in ./~/css-loader?{"minimize":false}!./src/shared/style-base/index.css
Module not found: Error: Can't resolve './colors' in '/Users/jamie/web/terraforming-mars-tools/src/shared/style-base'
@ ./~/css-loader?{"minimize":false}!./src/shared/style-base/index.css 3:10-94
@ ./src/shared/style-base/index.css
@ ./src ^\.\/(?!main(\.js)?$)
@ ./test/unit/index.js
I can work around this by using relative paths. For example if I wanted to include normalize.css I would have to use the following code:
I just updated to the new .postcssrc syntax, and here is my configuration:
// https://github.com/michael-ciniawsky/postcss-load-configmodule.exports={"plugins": {// to edit target browsers: use "browserlist" field in package.json"postcss-smart-import": {"path": ["src"]},"postcss-cssnext": {},}}
Thanks for reading and let me know if I can provide more details.
I've configured and am using
postcss-smart-import
to help with my CSS imports. This works beautifully with both thedev
andbuild
scripts defined in thepackage.json
however when I attempt to run theunit
script it fails and complains about modules not being resolved.The error is several iterations of this:
I can work around this by using relative paths. For example if I wanted to include
normalize.css
I would have to use the following code:I just updated to the new
.postcssrc
syntax, and here is my configuration:Thanks for reading and let me know if I can provide more details.
The app I'm working on is open source you can see it here: https://gitlab.com/Spittal/terraforming-mars-tools/tree/master
The text was updated successfully, but these errors were encountered: