Need help with webpack-fix-style-only-entries?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

247 Stars 21 Forks ISC License 68 Commits 5 Opened issues


Webpack plugin to solve the problem of having a style only entry (css/sass/less) generating an extra js file.

Services available


Need anything else?

Contributors list

npm version


This is a small plugin developed to solve the problem of having a style only entry (css/sass/less/stylus) generating an extra js file.

:warning: The current package version is not compatible with webpack 5. There is a fork here that is compatible:

You can find more info by reading the following issues:


View on: Github - npm

How it works

It just find js files from chunks of css only entries and remove the js file from the compilation.

How to use

install using your package manager of choice: - npm:

npm install -D webpack-fix-style-only-entries
- yarn:
yarn add -D webpack-fix-style-only-entries

Require and add to webpack.config plugins.

Warning: this plugin does not load styles or split your bundles, it just fix chunks of css only entries by removing the (almost) empty js file.

// ... other plugins
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");

module.exports = { entry: { "main" : "./app/main.js" "styles": ["./common/styles.css", "./app/styles.css"] }, module: { { test: /.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader', ] }, ] }, plugins: [ new FixStyleOnlyEntriesPlugin(), new MiniCssExtractPlugin({ filename: "[name].[chunkhash:8].css", }), ], };


| Name | Type | Default | Description | |------------|--------------- |----------------------------------------|-------------| | extensions | Array[string] | ["less", "scss", "css", "styl","sass"] | file extensions for styles | | silent | boolean | false | supress logs to console | | ignore | string or RegExp | undefined | match resource to be ignored |

Example config:

// to identify only 'foo' and 'bar' extensions as styles
new FixStyleOnlyEntriesPlugin({ extensions:['foo', 'bar'] }),


I use a javascript entry to styles:

Give an especial extension to your file (

for example) and configure
new FixStyleOnlyEntriesPlugin({ extensions:['css.js'] })
. See:

I use webpack-hot-middleware:

Configure this plugin as

new FixStyleOnlyEntriesPlugin({ ignore: 'webpack-hot-middleware' })
. See: and

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.