question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebPack CSS import fails with production mode; ok with dev mode

See original GitHub issue

When I compile (my ts) code in production mode

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

is ignored:

Screen Shot 2019-03-31 at 4 03 40 PM

when I compile in development mode the css is successfully applied

Screen Shot 2019-03-31 at 4 05 22 PM

Haven’t been able to find a workaround.

Worked fine in 4.x

in package.json:

  "scripts": {
    "dev": "webpack --mode development --config config/webpack.config.js",
    "build": "webpack --mode production --config config/webpack.config.js",

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
fkhadracommented, Apr 11, 2019

Fix pushed !

2reactions
SimonSchickcommented, Apr 11, 2019

@fkhadra just did, works now 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

when running npm run webpack for build for production mode ...
I have tried your code and it works fine, you only have a typo in first line (wrong spelling for npm ): const...
Read more >
Production | webpack
In this guide, we'll dive into some of the best practices and utilities for building a production site or application.
Read more >
The best webpack configurations for React applications
Go into the src/index.js and delete the imports of CSS and SVG files. ... And if we fail to pass an env to...
Read more >
How I solved and debugged my Webpack issue through trial ...
scripts": { "build": "webpack --mode production", "dev": "webpack-dev-server --mode development"}... You have to add a development flag when ...
Read more >
webpack Tutorial: How to Set Up webpack 5 From Scratch
the webpack-dev-server command is now webpack-serve ... create two config files: one with mode: production and one with mode: development .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found