Skip to content

Jake-Hu/custom-affix-css-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

custom-affix-css-loader

Introduction

This is a tool for adding CSS affixes,Its runtime depends on the webpack packaging environment。

Install

npm install --save-dev custom-affix-css-loader

Usage

After install the loader, adding the following code in your webpack.config.js:
        loaders:[
            {   
                test: /\.css$/,  
                loader: 'style-loader!css-loader!custom-affix-css-loader?{"type":"css","pre":"pre","suf":"suf"}'  
            },  
            {   
                test: /\.html$/,  
                loader: 'html-loader!custom-affix-css-loader?{"type":"html","pre":"pre","suf":"suf"}'  
            }  
        ]  

options

You can configure your loader in the form of parameters, like this: {"type":"css","pre":"pre","suf":"suf"}',Where "type" refers to the file type, "pre" refers to the class prefix, "suf" refers to the class suffix。 (css)for example:
    .container {
        background: #FFF;
    }
after packing:
    .pre-container-suf {
        background: #FFF;
    }
(html)for example:
    <div class="container"></div>
after packing:
    <div class="pre-container-suf"></div>

About

This is a tool for adding CSS affixes,Its runtime depends on the webpack packaging environment。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published