Skip to content
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

cssLoaderOption期望增加exportLocalsConvention选项 #10440

Closed
hasnum-stack opened this issue Oct 16, 2021 · 1 comment
Closed

cssLoaderOption期望增加exportLocalsConvention选项 #10440

hasnum-stack opened this issue Oct 16, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@hasnum-stack
Copy link

这个特性解决了什么问题?

cssModule时可以使用 style.listItem 而不是 style['list-item']

这个 API 长什么样?

cssLoaderOption:{
exportLocalsConvention:camelCase
}

@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Oct 16, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Oct 18, 2021

这样设置 Taro 编译配置即可:

cssLoaderOption:{
  localsConvention: 'camelCase'
}

小程序的编译时:@tarojs/mini-runner 使用的 css-loader 版本是 3.x,但 css-loader 4.x 的时候才把这个配置项移动为 modules.exportLocalsConvention

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants