@react-script/test
v0.0.14
Published
Vic 定制
Downloads
8
Readme
如何使用
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'),
]
}
}
],
}