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

fix(mini-runner): support vue sfc <style module> #11481

Closed
wants to merge 2 commits into from

Conversation

b2nil
Copy link
Collaborator

@b2nil b2nil commented Mar 19, 2022

这个 PR 做了什么? (简要描述所做更改)
由于 css-loader 的配置问题,目前在配置文件中 postcss 项目下启用 cssModules (module 模式)时,vue 单文件组件中使用 <style module> 无效。

cssModules: {
   enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
   config: {
          namingPattern: 'module', // 转换模式,取值为 global/module
          generateScopedName: '[local]_[hash:base64:6]'
   }
}

本 PR 增加了针对 vue 框架的 css-loader 相关配置。

这个 PR 是什么类型? (至少选择一个)

这个 PR 涉及以下平台:

  • 所有小程序

@SJanJan
Copy link

SJanJan commented Mar 20, 2022

现在可以了吗?怎么更新?

@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 12, 2022

感谢指出~

我们的设想本是不希望普通包里存在 platform === vue 这类判断,平台相关的逻辑都归到对应的插件包中。无奈此处目前的写法导致使用 webpack-chain 去修改的难度很大。所以我改为去掉平台判断逻辑,并且给 H5 也加上对应的 css-loader 配置。

@Chen-jj Chen-jj closed this Apr 12, 2022
@b2nil b2nil deleted the fix/cssModules branch April 14, 2022 02:45
@b2nil b2nil restored the fix/cssModules branch April 14, 2022 02:45
@b2nil b2nil deleted the fix/cssModules branch April 14, 2022 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V-3 Version - 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants