Tuesday 28 May 2019

Webpack 4 + Mini-CSS-Extract-Plugin rendering undefined CSS classes

I needed to reach out to somebody because I'm struggling here. Major apologies if this seems stupid, because I'm a Node noob.I inherited a project that was using webpack 3 and extract-text-webpack-plugin, and I had to upgrade to webpack 4. Upon upgrading, removing the old webpack.config, and re-ejecting the project using react-scripts. The problem is that somehow this has broken the CSS for the project. For instance I have an import statement for a component (the folder contains the JS file and the CSS file):import classes from './Masthead.css'; Then the style class from the CSS import is used in the JS:const masthead = (props) => { return (
props.history.push('/')}> (note that is just a snippet of the full code, this is just an illustration)When rendered, I'm expecting something like this:
Instead I'm getting:
I'd be happy to post some details about what is in my webpack.config, but it seems like it's all wired up correctly for the most part. Could I be missing anything else?Edit: here is my webpack.config.js.

Submitted May 28, 2019 at 04:59PM by ziptnf

No comments:

Post a Comment