Ihatetomatoes / webpack-101-bootstrap

Learn how to load Twitter Bootstrap with Webpack 2 and bootstrap-loader.
22 stars 76 forks source link

Bootstrap Modal and dropdown on dist folder not working w/ PurifyCSSPlugin #3

Open lmuzquiz opened 7 years ago

lmuzquiz commented 7 years ago

For some reason, the bootstrap modal and the dropdown menu won't open on the dist folder when using the PurifyCSSPlugin

marten-cz commented 7 years ago

@lmuzquiz Did you somehow solved this? I just hit the same problem.

ronjb04 commented 6 years ago

same issue here.. any solution for this yet?

ronjb04 commented 6 years ago

found a solution,, not sure if this is the best solution.. I learn that PurifyCSSPlugin is removing css that isn't declared in the dom, so modal and fade is being removed by PurifyCSSPlugin,, so all you have to do is whitelist these specific class.

https://github.com/webpack-contrib/purifycss-webpack infos about the plugin.

here is how i have resolved the modal issue. just search for "new PurifyCSSPlugin" in your webpack.config.js new PurifyCSSPlugin({ paths: glob.sync(path.join(__dirname, 'src/*.html')), purifyOptions: { whitelist: ['fade','in','open', '*modal*'] } })