This a 馃悰 bug report
// postcss.config.js
module.exports = {
modules: true,
plugins: {
"postcss-modules": {
globalModulePaths: ["./global/"]
}
}
};
// global/index.less
@import "../node_modules/antd/dist/antd.less";
antd.less no hash.
Example:
._anticon {
display: inline-block;
font-style: normal;
vertical-align: baseline;
text-align: center;
text-transform: none;
line-height: 1;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
._anticon_12kcc_348 {
display: inline-block;
font-style: normal;
vertical-align: baseline;
text-align: center;
text-transform: none;
line-height: 1;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel |1.6.3|
| Node |v8.9.4
| npm/Yarn |Yarn 1.3.2|
| Operating System |macOS 10.13.3|
I have the same problem. I managed to make the CSS file be generated correctly (both modules and non-modules) using this
// .postcssrc.js
module.exports = {
plugins: [
require('postcss-modules')({
globalModulePaths: [/\.global\./],
}),
],
};
The downside is that, for all CSS files I try to import in JS, I receive an empty object and for every CSS file I get an equivalent JSON file with the content I expect to be imported by JS. I haven't been able to fix this yet. I hope the team can help us work around this issue.
@DeMoorJasper you were the one who added the Bug label to the issue. Do you think its possible to make it work with the code I posted earlier?
@viniciusmelquiades I have no clue I just label issues based on the description. I鈥檇 have to look into it in more detail to know what鈥檚 going on
Sent with GitHawk
Any news on this? I am having the same issue with parcel 1.7 on node 10.
What's odd is that globalModulePaths seems to be respected in development mode, but as soon as I make a production build, _all_ css files are processed as modules ... 馃
maybe this can work.
https://github.com/parcel-bundler/parcel/issues/645#issuecomment-361008955
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
Most helpful comment
Any news on this? I am having the same issue with
parcel 1.7onnode 10.What's odd is that
globalModulePathsseems to be respected in development mode, but as soon as I make a production build, _all_ css files are processed as modules ... 馃