1. less-plugin-npm-import
npm import plugin for less.js
less-plugin-npm-import
Package: less-plugin-npm-import
Created by: less
Last modified: Thu, 03 Aug 2023 17:08:36 GMT
Version: 2.1.0
Downloads: 150,534
Repository: https://github.com/less/less-plugin-npm-import

Install

npm install less-plugin-npm-import
yarn add less-plugin-npm-import

NPM version Dependencies devDependency Status optionalDependency Status

less-plugin-npm-import

Adds the ability for less to import from npm packages

lessc usage

Install with npm

 npm install -g less-plugin-npm-import

In less file:

@import "npm://packagename/path/to/file.less";

css/less extensions not necessary

Options:
prefix - default: npm://

Command line usage

lessc --npm-import file.less file.css
lessc --npm-import="prefix=~" file.less file.css

Programmatic usage

var NpmImportPlugin = require("less-plugin-npm-import"),
    options = { plugins: [new NpmImportPlugin({prefix: '~'})] };
less.render(css, options)
    .then(...

Browser usage

Browser usage is not supported.

Testing

run the tests by running node test
You require the dev dependencies installed (which includes less)

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin