Là một dự án mã nguồn mở, webpack-contrib/extract-text-webpack-plugin đã đạt 4.0k sao trên GitHub, ngôn ngữ JavaScript. [DEPRECATED] Please use https://github.com/webpack-contrib/mini-css-extract-plugin Extracts text from a bundle into a separate file
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
Đọc thêm về webpack-contrib/extract-text-webpack-plugin ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/webpack-contrib/extract-text-webpack-plugin là nguồn chính thức.
webpack-contrib/extract-text-webpack-plugin có bao nhiêu sao?
webpack-contrib/extract-text-webpack-plugin có 4.0k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/webpack-contrib/extract-text-webpack-plugin. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
webpack-contrib/extract-text-webpack-plugin có những chủ đề gì?
GitHub topics của webpack-contrib/extract-text-webpack-plugin: "webpack-plugin". TopGit xếp repo vào nhóm mã nguồn mở.
webpack-contrib/extract-text-webpack-plugin có phải mã nguồn mở không?
Có — webpack-contrib/extract-text-webpack-plugin phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/webpack-contrib/extract-text-webpack-plugin.
webpack-contrib/extract-text-webpack-plugin có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho webpack-contrib/extract-text-webpack-plugin. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
webpack-contrib/extract-text-webpack-plugin còn đang phát triển không?
Commit gần nhất trên webpack-contrib/extract-text-webpack-plugin là 7.5 năm trước (theo timestamp GitHub). Repo có 507 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc extract-text-webpack-plugin có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về extract-text-webpack-plugin.