Skip to content

ymaxli/less-import-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

less-import-loader Build Status

add global dependencies to less file for webpack, this loader would resolve absolute global file path to relative path.

Installation

$ npm install less-import-loader --save-dev

How to use

add less-import-loader before less-loader

{
    test: /\.less$/,
    loader: "style!css!less!less-import-loader"
},

add less-import-loader option in webpack.config.js

lessImportLoader: {
    base: process.cwd() + '/src/less/base' // must be absolute path
}

Before:

src/test/a.less

a {
    color: white;
}

After:

@import "../less/base";
a {
    color: white
}

About

add global dependencies to less file for webpack

Resources

Stars

Watchers

Forks

Packages

No packages published