css-img-loader

1.0.0 • Public • Published

css-img-loader for webpack

背景

改装自file-loader,因为file-loadername即是内容中的路径也是输出文件的路径,不够灵活,css-img-loader增加了outputPath属性!

安装

    npm install css-img-loader --save-dev

用法

    {
        test:/\.(png|jpg)$/,
        loader: 'css-img-loader?limit=7&name=../img/[name].[ext]&outputPath=img/'
    }

name是内容中的路径,文件路径是outputPath+[name].[ext]形成的!其他用法和file-loader一致!

Readme

Keywords

none

Package Sidebar

Install

npm i css-img-loader

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • eastlee