1.安装初始化

npm create-react-app react-demo

2.安装初始化

npm run eject

3.配置sass / less

cnpm i  sass-loader node-sass -d


代码片段1:
  
  exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/, /.scss$/],
 
代码片段2:
  {
    test: /\.scss$/,
    loaders: ['style-loader', 'css-loader', 'sass-loader'],
  },
 

  

  在config下找到 webpack.config.dev.js、webpack.config.prod.js 文件  分别添加相关代码片段  (同理less)

       【react学习一】首先先create-react-app 配置less、sass

 

  

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-12-31
  • 2021-09-29
猜你喜欢
  • 2021-12-20
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
相关资源
相似解决方案