webpack-contrib/extract-text-webpack-plugin sits at 4.0k stars on GitHub, written primarily in JavaScript. [DEPRECATED] Please use https://github.com/webpack-contrib/mini-css-extract-plugin Extracts text from a bundle into a separate file
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
It moves all the required *.css modules in entry chunks into a separate CSS file. So your styles are no longer inlined into the JS bundle, but in a separate CSS file (styles.css). If your total stylesheet volume is big, it will be faster because the CSS bundle is loaded in parallel to the JS bundle.
Advantages
Caveats
Fewer style tags (older IE has a limit)
Additional HTTP request
CSS SourceMap (with devtool: "source-map" and extract-text-webpack-plugin?sourceMap)
Longer compilation time
CSS requested in parallel
No runtime public path modification
CSS cached separate
No Hot Module Replacement
Faster runtime (less code and DOM operations)
...
Options
new ExtractTextPlugin(options: filename | object)
Name
Type
Description
id
{String}
Unique ident for this plugin instance. (For advanced usage only, by default automatically generated)
filename
{String|Function}
Name of the result file. May contain [name], [id] and [contenthash]
allChunks
{Boolean}
Extract from all additional chunks too (by default it extracts only from the initial chunk(s)) When using CommonsChunkPlugin and there are extracted chunks (from ExtractTextPlugin.extract) in the commons chunk, allChunksmust be set to true
disable
{Boolean}
Disables the plugin
ignoreOrder
{Boolean}
Disables order check (useful for CSS Modules!), false by default
[name] name of the chunk
[id] number of the chunk
[contenthash] hash of the content of the extracted file
[<hashType>:contenthash:<digestType>:<length>] optionally you can configure
other hashTypes, e.g. sha1, md5, sha256, sha512
other digestTypes, e.g. hex, base26, base32, base36, base49, base52, base58, base62, base64
and length, the length of the hash in chars
:warning: ExtractTextPlugin generates a file per entry, so you must use [name], [id] or [contenthash] when using multiple entries.
The configuration is the same, switch out sass-loader for less-loader when necessary.
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
}
]
},
plugins: [
new ExtractTextPlugin('style.css')
//if you want to pass in options, you can do so:
//new ExtractTextPlugin({
// filename: 'style.css'
//})
]
}
url() Resolving
If you are finding that urls are not resolving properly when you run webpack. You can expand your loader functionality with options. The url: false property allows your paths resolved without any changes.
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
// If you are having trouble with urls not resolving add this setting.
// See https://github.com/webpack-contrib/css-loader#url
url: false,
minimize: true,
sourceMap: true
}
},
{
loader: 'sass-loader',
options: {
sourceMap: true
}
}
]
})
}
]
}
}
Modify filename
filename parameter could be Function. It passes getPath to process the format like css/[name].css and returns the real file name, css/js/a.css. You can replace css/js with css then you will get the new path css/a.css.
Does webpack-contrib/extract-text-webpack-plugin have a project website?
No homepage URL was recorded for webpack-contrib/extract-text-webpack-plugin in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How active is development on webpack-contrib/extract-text-webpack-plugin?
The most recent commit recorded on webpack-contrib/extract-text-webpack-plugin was 7.2 years ago, based on the GitHub push timestamp. The repository has 507 forks — one of the better signals of community interest.
How many stars does webpack-contrib/extract-text-webpack-plugin have?
webpack-contrib/extract-text-webpack-plugin has 4.0k GitHub stars — refresh the page for the live number, or check github.com/webpack-contrib/extract-text-webpack-plugin. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is webpack-contrib/extract-text-webpack-plugin open source?
Yes — webpack-contrib/extract-text-webpack-plugin ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/webpack-contrib/extract-text-webpack-plugin.
What topics is webpack-contrib/extract-text-webpack-plugin associated with?
GitHub's repository topics for webpack-contrib/extract-text-webpack-plugin: "webpack-plugin". TopGit's editorial category is open-source.
Where do I read more about webpack-contrib/extract-text-webpack-plugin?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/webpack-contrib/extract-text-webpack-plugin is the definitive source.
Read full README in the tab above.
Curious whether extract-text-webpack-plugin is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about extract-text-webpack-plugin.