package
blazing fast css loader for webpack
npm install fast-css-loaderGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Blazingly fast css loader for webpack (about 10 times faster than css-loader when process large css files)
npm install fast-css-loader --save-devfast-css-loader has higher performance when processing large css files, here is an example when process a 24200+ lines css file:
-------------------------------------
CSS_LOADER COST: 1644 ms
FAST_CSS_LOADER COST: 116 ms
-------------------------------------
fast-css-loader rewrites resolving parts of @import and url(...) with RegExp
and some tricks, it's extramely faster than postcss used by css-loader.
Compare with css-loader, fast-css-loader has these limitations:
camelCase optionIf you really need these features, just use original css-loader :)
just like css-loader:
module.exports = {
module: {
rules: [
{
test: /\.(svg|bmp|gif|png|jpe?g)$/,
loader: require.resolve('file-loader'),
options: {
name: '[name].[hash:8].[ext]'
}
},
{
test: /\.css$/,
use: [
'style-loader',
'fast-css-loader' // replace you css-loader with fast-css-loader
]
},
]
}
}| Name | Type | Default | Description |
|---|---|---|---|
root | {String} | / | Path to resolve URLs, URLs starting with / will not be translated |
url | {Boolean} | true | Enable/Disable url() handling |
alias | {Object} | {} | Create aliases to import certain modules more easily |
import | {Boolean} | true | Enable/Disable @import handling |
importLoaders |
The above listed options are consistent with css-loader, for more detail please refer to css-loader options
MIT
{Number}0 |
| Number of loaders applied before CSS loader |
Estimated unpacked size across 6 packages.
50.1 kB
Includes dependencies.