Anyone tried to make an application with
dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
dotnet new angular
? like in this example https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/
This command makes an angular + .net core project with bootstrap 3. I'm trying to put bootstrap 4 instead.
I tried to put bootstrap 4 css over vendor.css (where bootstrap 3 is located) but without succes.
Does anyone know how to put bootstrap 4 over bootstrap 3?, eventually with the javascript plugins jquery and popper.
It would be very helpful, thanks!
For the sake of clarity, this is what worked for me.
package.json
and update the bootstrap entry to"bootstrap": "4.0.0"
, or whichever version you requirenode_modules
foldernpm install popper.js --save
in command promptnpm install
in command promptwebpack --config webpack.config.vendor.js
in command promptA couple of notes:
npm-shrinkwrap.json
has been heavily modified. I believe this is to do with upgraded versions of npm, but I'm no expert. Here's some further reading on the subject What is the difference between npm-shrinkwrap.json and package-lock.json?I've also put together a working sample of the template on GitHub here https://github.com/alterius/AngularSPABootstrap4
Since some js components in Bootstrap 4 depends on Tether.js add
"bootstrap": "4.0.0-alpha.6"
and"tether": "^1.4.0"
to yourpackage.json
then deletenode_modules
folder and runnmp install
then because of Bootstrap checking fortether
add this to plugins in yourwebpack.config.vendor.js
then run
references are: this issue , this and this
You can update the bootstrap version in your
package.json
like thisand delete your node_modules and do a
npm install
again.That's it. You don't need to touch the
webpack.config.vendor.js
because it already referenced the bootstrap css'bootstrap/dist/css/bootstrap.css',
Whenever you add/remove something in webpack, you need to generate the bundle.
And run
to generate the main bundle. Hope this helps.