0.2.1 • Published 5 years ago

@thomann/less-plugin-nodemodules-import v0.2.1

Weekly downloads
14
License
UNLICENSED
Repository
github
Last release
5 years ago

less-plugin-nodemodules-import

This plugin provides less imports from node_modules, just like less/less-plugin-npm-import and webpack's less-loader do.

Usage

Install with npm (or yarn):

$ npm install @thomann/less-plugin-nodemodules-import

Programmatic Usage

Register with your less instance:

const LessPluginNodeModulesImport = require('@thomann/less-plugin-nodemodules-import');
less.render(anyFile, {plugins: [new LessPluginNodeModulesImport(opts)]});

Command-Line Usage

$ lessc --plugin=@thomann/less-plugin-nodemodules-import <less-file>

To define options with command line usage, pass a JSON object string with the parameters as less plugin option:

$ lessc --plugin=@thomann/less-plugin-nodemodules-import={"mainFile":"main.less"}

Note that the parameters have to be valid JSON.

Options

OptionKeyValue TypeDefaultDescription
importPathsarrayvalues from require.module.pathsThe paths to find imports in
mainFilestringindex.lessWhich file to load if the import is a directory
encodingstringutf-8Encoding for reading imported files

Directories in importPaths have to be absolute or relative to the executing file.

0.2.1

5 years ago

0.2.0

5 years ago

0.0.1

5 years ago