Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Bootstrap's jQuery dependency #7

Closed
wosc opened this issue Apr 10, 2015 · 1 comment
Closed

Handle Bootstrap's jQuery dependency #7

wosc opened this issue Apr 10, 2015 · 1 comment

Comments

@wosc
Copy link

wosc commented Apr 10, 2015

Straight up with a require("bootstrap-webpack"); my browser says "ReferenceError: jQuery is not defined" with most of Bootstrap's script modules.

I've added jquery as a dependency in package.json and this in webpack.config.js to fix it:

module: {
    loaders: [
        {
            test: /\/bootstrap\/js\//,
            loader: "imports?jQuery=jquery"
        },
}
@gowravshekar
Copy link
Owner

You need to expose the (jquery, $) variables for other third party libraries to use.
Use this in your entry script

require('expose?$!expose?jQuery!jquery');

Also webpack as an argument called --display-error-details that will help you debug stuff like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants