We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Rax Core
1: 有类似上面这种小组件,,我单独把它发布成npm包,比如叫他“@ali/Icon-Comp”
import { createElement } from 'rax'; import cssModule from './index.module.css'; import View from 'rax-view'; const Icon = (props) => { return ( <View style={{ position: 'relative', width: '48rpx', height: '48rpx' }} > <View className={cssModule.deg45} /> <View className={cssModule.deg315} /> </View> ); }; export default Icon;
2: 然后再rax应用里进行使用:
import Icon from '@ali/Icon-Comp'
页面的build.json见下方:
本来应给是个cssmodule的类名,结果打包出来不对。
然而,如果组件写在项目里,是可以的。 但是抽出来,搞成npm包,再引入,就不行
"rax-app": "^3.8.7",
{ "targets": [ "web", "weex-v2" ], "web": { "mpa": true, "pha": false }, "weex": { "mpa": true, "mode": "dom" }, "swc": false, "plugins": [ "@ali/build-plugin-rax-app-def", "@ali/plugin-rax-weex-v2" ], "webpack5": true, "inlineStyle": { "forceEnableCSS": true } }
No response
The text was updated successfully, but these errors were encountered:
组件层面不建议使用 css module,试下直接用 import 'index.css' 的方式导入 css
import 'index.css'
Sorry, something went wrong.
No branches or pull requests
⌨️
Where is the bug from?
Rax Core
Minimal code and steps to reproduce the bug
1: 有类似上面这种小组件,,我单独把它发布成npm包,比如叫他“@ali/Icon-Comp”
2: 然后再rax应用里进行使用:
import Icon from '@ali/Icon-Comp'
页面的build.json见下方:
Current and expected behavior
本来应给是个cssmodule的类名,结果打包出来不对。
然而,如果组件写在项目里,是可以的。 但是抽出来,搞成npm包,再引入,就不行
Environment
"rax-app": "^3.8.7",
build.json
{
"targets": [
"web",
"weex-v2"
],
"web": {
"mpa": true,
"pha": false
},
"weex": {
"mpa": true,
"mode": "dom"
},
"swc": false,
"plugins": [
"@ali/build-plugin-rax-app-def",
"@ali/plugin-rax-weex-v2"
],
"webpack5": true,
"inlineStyle": {
"forceEnableCSS": true
}
}
Possible solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: