我有一个反应应用程序,它是使用 create-react-app 创建的。我在我的项目中包含了 react-bootstrap,当我启动/构建应用程序时,导入了引导 css 文件。如何用我的自定义 CSS 更改这个 CSS?我知道我可以在 index.js 中添加新的 css,但在这种情况下不会导入两个 css 文件吗?
由于我正在创建自定义引导主题,因此我希望不导入默认引导 css 文件,因为我正在从自定义 scss 文件和引导 scss 文件构建新的 css 文件。
我的 package.json:
{
"name": "reading-manager-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap": "^3.3.7",
"chart.js": "^2.7.2",
"react": "^16.4.2",
"react-bootstrap": "^0.32.1",
"react-chartjs-2": "^2.7.4",
"react-dom": "^16.4.2",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
npm start 生成:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
如何将这些导入更改为我自己编译的导入?我宁愿不使用远程存储库。