Skip to content

import Bootstrap 3 JavaScript #5542

@stevenbriscoeca

Description

@stevenbriscoeca

Hello,

So I know the easiest way to do this is to add everything in index.html, but I was wondering if there was a way to add everything with the import statement.

Here is what I did :

npm install jquery
npm install bootstrap@3

In app.js

import 'bootstrap/dist/css/bootstrap.min.css';

import 'jquery/dist/jquery.min';
import 'bootstrap/dist/js/bootstrap.min';
import $ from 'jquery';

I keep getting an error :
Error: Bootstrap's JavaScript requires jQuery

I look in bundle.js and jquery seems to be added after bootstrap. Anyway I can change the order?

I know I can use react-bootstrap, but I'm really trying to make this work.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions