css-modules / css-modules-require-hook

A require hook to compile CSS Modules in runtime
MIT License
484 stars 44 forks source link

Bootstrap's JavaScript requires jQuery #100

Closed acmoune closed 7 years ago

acmoune commented 7 years ago

I am using css-modules-require-hook to render a react app on the server, but I am having the Error: Bootstrap's JavaScript requires jQuery.

With client side webpack I fix it with this plugin config:

plugins: [
    new webpack.ProvidePlugin({
      $: "jquery",
      jquery: "jquery",
      "window.jQuery": "jquery",
      jQuery:"jquery"
    })
]

How can I proceed server side, using css-modules-require-hook ?

Thanks in advance.

mightyaleksey commented 7 years ago

Hello,

Unfortunately, css-modules-require-hook doesn't add any browser environment. You may try to add a custom polyfill to the nodejs environment via global variable, jsdom and jquery packages.

acmoune commented 7 years ago

Thanks for your reply @sullenor