How to fix "Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js)" in Elixir Phoenix. If you are new to Elixir Phoenix, on your very first attempt to create the app and run the server with mix phx.server you might have encountered this build error related to Node, Sass, and CSS.
You may also extract the CSS based on the webpack entry name. This is especially useful if you import routes dynamically but want to keep your CSS bundled according to entry. This also prevents the CSS duplication issue one had with the ExtractTextPlugin. const path = require('path'); const MiniCssExtractPlugin = require("mini-css-extract-plugin");.