Skip to content

基于create-react-app、typescript、less等结合实际使用的模板仓库

Notifications You must be signed in to change notification settings

DevBoilerplate/easy-react

Repository files navigation

easy-react

基于create-react-app、typescript、less等结合实际使用的模板仓库

Features

  • craco支持webpack配置的更改
  • yarn作为包管理工具
  • yarn autoclean支持依赖的杂项自动清理
  • .editorconfig支持对编辑器进行约束
  • eslint代码质量约束
  • prettier代码风格约束
  • 支持typescript
  • 支持husky工作流控制
  • 支持react-router-dom
  • 支持热更新
  • webpack-bundle-analyzer支持打包大小分析
  • 支持less

Attentions

  • 关于开启cssModules的问题(默认不开启cssModules)

【less和cssModules在url(...)语句计算相对路径位置的问题issue解释

开启cssModules的配置

// craco.config.js配置文件

const CracoLessPlugin = require("craco-less")

module.exports = {
  plugins: [
    {
      plugin: CracoLessPlugin,
      options: {
        cssLoaderOptions: {
          modules: { localIdentName: "[local]_[hash:base64:5]" }
        }
      }
    }
  ]
}

bugs

  • craco对CRA4.x的eslint报错问题 #205

References

About

基于create-react-app、typescript、less等结合实际使用的模板仓库

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published