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
我看文档里描述css也可以模块化:
使用注释中的@require xxx来标记依赖
/** * 引用模块 * @require font-awesome * * 引用文件 * @require ./bar.css */ .foo .fa { font-size: 20px; }
但这样css还是需要依赖同名的js来完成加载。
我通过生态模块的component.json的main指定css文件,是可以自动安装纯css组件的
但是如果在components文件夹下建立组件,只放与组件同名的css文件,编译会报错,我翻了下源码:
else if(file.isMod && (file.isJsLike || file.isCssLike)){ if(file.isJsLike){ var match = file.subpath.match(/^\/components\/(.*?([^\/]+))\/\2\.(js|jsx)$/i); if(match && match[1] && !map.alias.hasOwnProperty(match[1])){ map.alias[match[1]] = id; } } if(file.requires.length){ map.deps[id] = file; }
这里只处理了js模块,并没有处理纯css的模块。我觉得纯css模块也很合理啊,如果能配合less/sass就更好了,可否扩展支持纯css的组件
The text was updated successfully, but these errors were encountered:
fouber
No branches or pull requests
我看文档里描述css也可以模块化:
但这样css还是需要依赖同名的js来完成加载。
我通过生态模块的component.json的main指定css文件,是可以自动安装纯css组件的
但是如果在components文件夹下建立组件,只放与组件同名的css文件,编译会报错,我翻了下源码:
这里只处理了js模块,并没有处理纯css的模块。我觉得纯css模块也很合理啊,如果能配合less/sass就更好了,可否扩展支持纯css的组件
The text was updated successfully, but these errors were encountered: