react create-react-app 打包和引入scss

  1. 项目文件夹\node_modules\react-scripts\config里面的paths.js文件pathname改成./就可以了
  2. windows系统下:set PUBLIC_URL=./ yarn build  mac、linux系统下:PUBLIC_URL=./ yarn build

        打包传送门

  2.引入scss

代码

在打包的webpack文件中做相同配置

猜你喜欢

转载自blog.csdn.net/qq_41834059/article/details/82345011
今日推荐