How can I remove Bootstrap from my Angular project?
First : Remove bootstrap dependency From your package.json
as shown below for example:
"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"bootstrap": "^3.3.1", <-------REMOVE THIS
"core-js": "^2.5.4",
"rxjs": "6.0.0",
"zone.js": "^0.8.26"
},
Second : Remove the bootstrap url from angular.json
, if you have placed it under styles section like as shown below
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css" <--- REMOVE THIS
],
Third : Check and Remove any bootstrap references explicitly imported in styles.css
or any other files remotely or locally like as shown below
@import '~bootstrap/dist/css/bootstrap.min.css';
npm uninstall bootstrap --no-save
also remove the reference you added in angular.json under styles which points bootstrap.min.css
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],