显示配置文件
npm run eject // 或者 yarn run eject
配置 config/webpack.config.js
const cssRegex = /\.css$/; const cssModuleRegex = /\.module\.css$/; const sassRegex = /\.(scss|sass)$/; const sassModuleRegex = /\.module\.(scss|sass)$/; // 添加test const stylusRegex = /\.styl$/; ... // 添加loader配置 { test: stylusRegex, use: getStyleLoaders( { importLoaders: 2, sourceMap: isEnvProduction && shouldUseSourceMap, }, 'stylus-loader' ) },
安装插件
// 安装 stylus npm i --save-dev stylus // 安装loader npm i --save-dev stylus-loader