Basically i have my css and scss imported from index.js.
Everything is ok in dev. But in production build the css from toastify from node_modules that is imported like this import 'react-toastify/dist/ReactToastify.css'
is not appears in styles.css so its not added to main css bundle.
here is webpack config:
const webpack = require('webpack');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const path = require('path');
Basically i have my css and scss imported from index.js. Everything is ok in dev. But in production build the css from toastify from node_modules that is imported like this
import 'react-toastify/dist/ReactToastify.css'
is not appears in styles.css so its not added to main css bundle. here is webpack config: const webpack = require('webpack'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const path = require('path');module.exports = { mode: "production",
devServer: { inline: true, historyApiFallback: { index: '/' }, },
plugins: [ new webpack.DefinePlugin(injectConfig), new MiniCssExtractPlugin({ filename: './css/styles.css', chunkFilename: '[id].[hash].css', allChunks: true, }) ] ,
}
i noticed if i remove the splitChunks part- the toastify css appears in styles.css bundle, but with this part it does not. Sorry for bad indent.
mini-css-extract-plugin": "^0.4.1" "webpack": "^4.16.2" node: 8.11.3