Skip to content

Easy Webpack configuration module for using Less in your Webpack applications.

License

Notifications You must be signed in to change notification settings

easy-webpack/config-less

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@easy-webpack/config-less

This config allows you to bundle Less in your webpack bundle using less-loader.

This use config-css to achieve loading of CSS module. It is highly recommended to read the documentation of config-css before using this module.

Installation

npm install --save-dev @easy-webpack/config-less

easy-webpack is also required.

Usage

// webpack.config.js
const generateConfig = require('@easy-webpack/core').generateConfig;

const baseConfig = { ... }; // project-specific config like the entry file

module.exports = generateConfig(
  baseConfig,

  require('@easy-webpack/config-less')
    ({/* Options object */ filename: 'styles.css', allChunks: true, sourceMap: false })
);

// This config will compile less file imported and generate a CSS file named 'style.css' on output path 

Options

All options (except the below one) are identical to that of config-css. Please refer to their documentation.

additionalLoaders

Type: string[] Default: []

This option need special notice as it may cause confusion.

All loaders string in this config option array will be append before less-loader.

For example,

const generateConfig = require('@easy-webpack/core').generateConfig;

generateConfig(
  require('@easy-webpack/config-less')
    ({ additionalLoaders: ['postcss-loader'], extractText: false })
)

// Final loader string will be 'style-loader!css-loader!postcss-loader!less-loader'

About

Easy Webpack configuration module for using Less in your Webpack applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •