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

feat(stylus): 添加stylus支持 #3483

Merged
merged 2 commits into from
Oct 31, 2019
Merged

feat(stylus): 添加stylus支持 #3483

merged 2 commits into from
Oct 31, 2019

Conversation

fengxinming
Copy link
Contributor

@fengxinming fengxinming commented Oct 22, 2019

修改了两个模块 af-webpack 和 umi-build-dev

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

修改了两个模块 af-webpack 和 umi-build-dev
@netlify
Copy link

netlify bot commented Oct 22, 2019

Ant Design Pro preview using the current branch umi

Built with commit 18a9bbd

https://deploy-preview-3483--pro-pre-umijs.netlify.com

@coveralls
Copy link

coveralls commented Oct 22, 2019

Pull Request Test Coverage Report for Build 8149

  • 11 of 16 (68.75%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 39.534%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/af-webpack/src/getUserConfig/configs/stylus.js 1 2 50.0%
packages/af-webpack/src/getWebpackConfig/css.js 10 14 71.43%
Totals Coverage Status
Change from base Build 8148: 0.1%
Covered Lines: 4988
Relevant Lines: 12494

💛 - Coveralls

@@ -9,6 +9,9 @@ const DEFAULT_BROWSERS = [
'not ie < 9', // React doesn't support IE8 anyway
];

const DEFAULT_STYLUS_LOADER = 'stylus-loader';
const DEFAULT_STYLUS_OPTIONS = { preferPathResolver: 'webpack' };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里没必要常量

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ycjcl868 我一般写工具都比较灵活,这里主要是配合配合解构,现在的代码合并不了,是这个原因吗?这个工程运行npm run test报错某个文件找不到,目前先build模块代码,把build后的几个文档复制到本地demo中测试正常。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ycjcl868 请问本地如何跑单元测试,如何指定build哪几个模块,能不能在工程中加一个readme?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorrycc 好滴,没问题就尽快合并吧!

@sorrycc
Copy link
Member

sorrycc commented Oct 24, 2019

需要加一个用例。

@fengxinming
Copy link
Contributor Author

fengxinming commented Oct 28, 2019

需要加一个用例。

在af-webpack模块下增加了一个stylus的单元测试,yarn debug af-webpack模块正常,现在需要怎么弄?@sorrycc
PS: 那个CONTRIBUTING.md文件需要再写详细点,直接yarn debug都是报错。

@sorrycc sorrycc merged commit b65a74e into umijs:master Oct 31, 2019
@Wxh16144
Copy link
Member

Wxh16144 commented Jun 5, 2020

请教一下,我正在使用Umi 3.2.3
想在项目中使用 stylus,然后看到这个PR已经合并了
但是文档中又说明内置不支持 sassstylus (有点疑惑了)
我应该怎样去看我当前是否支持 stylue,谢谢

@fengxinming
Copy link
Contributor Author

@Wxh16144 umi3废弃调了之前的webpack配置重新写了,所以这代码不见了

@transtone
Copy link

transtone commented Sep 29, 2021

.umirc.js

export default {
  // ... more config
  chainWebpack(config, { createCSSRule }) {
     createCSSRule({
      lang: 'stylus',
      type: 'csr',
      test: /\.styl$/,
      loader: 'stylus-loader',
    });
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] 支持stylus-loader
6 participants