You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bootstrap is dependent on [jQuery](https://jquery.com/) and [Popper](https://popper.js.org/), so npm will install them for you if needed. But they must be explicitly provided by webpack. Add the following code to the `plugins` section in your webpack config file:
30
-
31
-
{% highlight js %}
32
-
// don't forget to import webpack (using import or require) to use webpack.ProvidePlugin
33
-
plugins: [
34
-
...
35
-
new webpack.ProvidePlugin({
36
-
$: 'jquery',
37
-
jQuery: 'jquery',
38
-
'window.jQuery': 'jquery',
39
-
Popper: ['popper.js', 'default'],
40
-
// In case you imported plugins individually, you must also require them here:
Bootstrap is dependent on [jQuery](https://jquery.com/) and [Popper](https://popper.js.org/),
30
+
these are defined as `peerDependencies`, this means that you will have to make sure to add both of them
31
+
to your `package.json` using `npm --save jquery popper.js`.
48
32
49
33
{% callout warning %}
50
34
Notice that if you chose to **import plugins individually**, you must also install [exports-loader](https://github.com/webpack-contrib/exports-loader)
0 commit comments