@react-script/test
TypeScript icon, indicating that this package has built-in type declarations

0.0.14 • Public • Published

如何使用

npx create-react-app <project-name> --scripts-version=@react-script/test --typescript

禁用依赖树的检查

添加 .env 文件

SKIP_PREFLIGHT_CHECK=true

开启 eslint、eslintignore

{
  test: /\.(js|mjs|jsx|ts|tsx)$/,
  enforce: 'pre',
  use: [
    {
      options: {
        ignore: true,
        useEslintrc: true,
      }
    }
  ]
}

添加 stylus,全局自动注入 less sass stylus 变量

const stylusRegex = /\.(styl|stylus)$/
const stylusModuleRegex = /\.module\.(styl|stylus)$/

{
  test: stylusRegex,
  exclude: stylusModuleRegex,
  use: [
    {
      loader: 'style-resources-loader',
      options: {
        patterns: [
          path.resolve(paths.appSrc, 'assets/styles/auto-inject/*.styl'),
        ]
      }
    }
  ],
},
{
  test: stylusModuleRegex,
  use: [
    {
      loader: 'style-resources-loader',
      options: {
        patterns: [
          path.resolve(paths.appSrc, 'assets/styles/auto-inject/*.styl'),
        ]
      }
    }
  ],
}

Readme

Keywords

none

Package Sidebar

Install

npm i @react-script/test

Weekly Downloads

13

Version

0.0.14

License

MIT

Unpacked Size

152 kB

Total Files

52

Last publish

Collaborators

  • yesixuan