Skip to content

Commit

Permalink
webpack config: add support for bootstrap 4 beta 2
Browse files Browse the repository at this point in the history
Bootstrap is dependent on jQuery and Popper, so they must be
provided explicitly by webpack.

This commit includes a new plugin to webpack to fixe a
problem related to jQuery and according to the configuration
example provided here:
http://getbootstrap.com/docs/4.0/getting-started/webpack/

The dependency on Popper should be resolved by including
`bootstrap.bundle.js` instead of only `bootstrap.js` in the
project imports.
The bundled version of bootstrap includes popper since this
pull request and should not be a problem in the future.
twbs/bootstrap#23735
  • Loading branch information
chbaldy committed Dec 18, 2017
1 parent 0839b9a commit d8a7af2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/webpack_get_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ module.exports = function (basePath) {
break
}

const providePlugin = new webpack.ProvidePlugin({
$: 'jquery',
})
plugins.push(providePlugin)

return {
cache: true,
context: basePath,
Expand Down

0 comments on commit d8a7af2

Please sign in to comment.