replace-css-url-loader
v1.0.5
Published
Webpack plugin to transform download cdn urls in css and replaced with local file path
Downloads
130
Maintainers
Readme
replace-css-url-loader
Webpack loader to transform css urls using custom function.
Install
npm i -D replace-css-url-loader
Usage
When you want to trasform url(https://at.alicdn.com/t/font_148784_v4ggb6wrjmkotj4i.woff)
to url(./static/antd/font.woff)
, in your projects' assets
folder, the webpack.config.js
is below
module.exports = {
...
module: {
rules: [
...
{
test: /\.css$/,
use: [
'css-loader',
'replace-css-url-loader'
],
},
...
],
},
Note
For .less
file, you can place this plugin between less-loader
and css-loader
.