Tuesday, 15 January 2019

Get/import bootstrap.js from Webpack bundle.js

Sorry i not have experience with webpack.

I have a template page generated with Webpack.

The page show modal dialog with bootstrap.js

The bootstrap.js included in bundle.js

I need show/hide/listen event of modal windows but i can not use $('#dialog').modal('hide') because bootstrap not loaded (in current context?)

How i can import/get access to bootstrap.js in bundle.js?

Examples - try to close modal with button "Close with JS"

Sample #1 used bootstrap.js from bundle.js

Error

$(...).modal is not a function

Sample #2 used bootstrap.js from bundle.js and in html

Error

not removed modal-backdrop fade



from Get/import bootstrap.js from Webpack bundle.js

No comments:

Post a Comment