gopangolin / wp-reactivate

React boilerplate for WordPress plugins
GNU General Public License v3.0
333 stars 83 forks source link

Cannot load css file from an external module. #9

Closed reactone closed 5 years ago

reactone commented 5 years ago

I am trying to add React Tostify module on a clean install of your plugin as a shortcode and I have problems loading the css file from this module. I am loading the css file in shortcode.jsx via:

import 'react-toastify/dist/ReactToastify.css';

I get the following error:

Uncaught Error: Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type.

.Toastify__toast-container

I've tried putting the css file in the same folder as the shortcode and play around with webpack.config.js but nothing seems to work. Any advice would be appreciated.

reactone commented 5 years ago

If anyone has the same problem - you will need to add a css loader to webpack.

dnusca commented 5 years ago

Closing as not related to actual plugin boilerplate but an external dependancy.