villeristi / vue.js-starter-template

A starter template for Vue.js projects
https://vue-starter.ville.io/
MIT License
264 stars 67 forks source link

How can I add bootstrap javascript files to webpack #14

Closed sfrjrs closed 7 years ago

sfrjrs commented 7 years ago

Hello, This is a great starter template so far, I'm new to vue and webpack. How can I add the bootstrap 4 javascript files so the mobile menu drop down works?

villeristi commented 7 years ago

Hi, Bootstrap JS has a depency to jQuery which is a general no-no (highly opinionated...) on modern SPA. I'd suggest you to use Bootstrap for Vue instead!

anpegar commented 7 years ago

Hi sfrjrs, villeristi is right but if you still want to use jQuery in whole of your project you should add this code in /webpack/plugins.js and install jQuery (npm install jquery --save-dev)

new webpack.ProvidePlugin({
            $: "jquery",
            jQuery: "jquery"
        })

I hope you find it useful.

PD: Villeristi thanks for this great template :+1:

sfrjrs commented 7 years ago

@villeristi @anpegar - Thank you guys for your feedback. I've been away for awhile and haven't been able to update my POC. I wasn't even aware that vue had their own vue-strap components. Once again, thank you!