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

Fix Bootstrap import #1

Merged
merged 2 commits into from
Dec 10, 2016
Merged

Fix Bootstrap import #1

merged 2 commits into from
Dec 10, 2016

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Dec 10, 2016

Bootstrap JS relies on jQuery being a global variable. (That’s pretty weird but I guess that’s how it works.)

In ES6, all imports are hoisted to the top of the file so if we used import to import Bootstrap, it would execute earlier than we have assigned the global variable.

This is why we have to use CommonJS require() here since it doesn't get hoisted. This lets us assign the variable earlier.

I also changed the imports to use unminified version since we minify everything as a build step anyway.

@kevgathuku kevgathuku merged commit 236b9d8 into kevgathuku:master Dec 10, 2016
@cmdrafa
Copy link

cmdrafa commented Sep 15, 2017

This is not working anymore right ?

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

Successfully merging this pull request may close these issues.

3 participants