-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
The properties of the object returned by css modules auto transform to lowerCamelCase
#8605
Comments
How can I modify the configuration |
@xyy94813 can you provide a reproduction repo for this? That would make it much simpler to diagnose this issue. |
@xyy94813 Have you checked out #onCreateWebpackConfig in docs? And #376 (comment) suggests that both should be available (kebab and camel case)? Don't have a way of trying it out quickly right now, maybe it has been changed? |
Thanks for providing the context @CanRau. @xyy94813 This was mentioned in the migrating from v1 to v2 guide. If you want to change this behavior you'll need to add custom webpack config. You'll need make changes like below in // gatsby-node.js
exports.onCreateWebpackConfig = ({
stage,
rules,
loaders,
plugins,
actions,
}) => {
actions.setWebpackConfig({
module: {
rules: [
{
test: /\.less$/,
use: [
loaders.css({ camelCase: false })
],
},
],
},
})
} Also in Let us know if you need more help. 😄 |
@kakadiadarpan thanks for providing the code 👍 didn't had the patience to dig more into it at that time^^ |
@kakadiadarpan thanks for your help. it is better, if there are some way to override it in |
@xyy94813 It's not possible to override this from
|
could you get the desired result @xyy94813? If so we could close the issue, otherwise let us know how we can support you |
if the gatsby-plugin-less provide a option, i will become possible
But i am not sure it is a better way. |
Summary
I am trying to migrate v1 to v2. In my project, i used
gatsby-plugin-less
,CSS Modules
andReact-CSS-Modules
.I found all properties of the object returned by css modules auto transform to
lowerCamelCase
, although i use-
to split word.Relevant information
My less file
style.module.less
:My Component file
MyComponent.js
Environment (if relevant)
System:
OS: macOS High Sierra 10.13.3
CPU: x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.9.1 - /usr/local/bin/node
Yarn: 1.3.2 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 69.0.3497.100
Safari: 11.0.3
npmPackages:
gatsby: ^2.0.8 => 2.0.8
gatsby-link: ^2.0.1 => 2.0.1
gatsby-plugin-antd: ^2.0.2 => 2.0.2
gatsby-plugin-import: ^2.0.1 => 2.0.1
gatsby-plugin-less: ^2.0.5 => 2.0.5
gatsby-plugin-react-helmet: ^3.0.0 => 3.0.0
npmGlobalPackages:
gatsby-cli: 2.4.2
File contents (if changed)
gatsby-config.js
:package.json
:gatsby-node.js
:gatsby-browser.js
:gatsby-ssr.js
:The text was updated successfully, but these errors were encountered: