{"id":15776991,"url":"https://github.com/jaywcjlove/rollup-plugin-less","last_synced_at":"2025-03-14T07:32:51.464Z","repository":{"id":43341684,"uuid":"248281616","full_name":"jaywcjlove/rollup-plugin-less","owner":"jaywcjlove","description":"A rollup plugin for less files.","archived":false,"fork":false,"pushed_at":"2024-09-21T21:59:29.000Z","size":48,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T11:13:07.911Z","etag":null,"topics":["less","rollup","rollup-plugin"],"latest_commit_sha":null,"homepage":"https://jaywcjlove.github.io/rollup-plugin-less/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaywcjlove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jaywcjlove","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":"https://jaywcjlove.github.io/sponsor.html"}},"created_at":"2020-03-18T16:15:08.000Z","updated_at":"2023-04-07T04:15:52.000Z","dependencies_parsed_at":"2022-09-02T18:01:57.550Z","dependency_job_id":"a577c415-5f6f-49cb-88cc-b78edcbca7ae","html_url":"https://github.com/jaywcjlove/rollup-plugin-less","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":"0.36111111111111116","last_synced_commit":"f1312a91d9034aa7e4949a32262bd55d37e27294"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Frollup-plugin-less","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Frollup-plugin-less/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Frollup-plugin-less/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Frollup-plugin-less/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaywcjlove","download_url":"https://codeload.github.com/jaywcjlove/rollup-plugin-less/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243422749,"owners_count":20288514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["less","rollup","rollup-plugin"],"created_at":"2024-10-04T17:41:55.872Z","updated_at":"2025-03-14T07:32:51.430Z","avatar_url":"https://github.com/jaywcjlove.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jaywcjlove","https://jaywcjlove.github.io/sponsor.html"],"categories":[],"sub_categories":[],"readme":"Rollup Plugin Less\n===\n\n[![](https://img.shields.io/github/stars/jaywcjlove/rollup-plugin-less.svg)](https://github.com/jaywcjlove/rollup-plugin-less/stargazers)\n[![](https://img.shields.io/github/release/jaywcjlove/rollup-plugin-less.svg)](https://github.com/jaywcjlove/rollup-plugin-less/releases)\n[![](https://img.shields.io/npm/v/@wcj/rollup-plugin-less.svg)](https://www.npmjs.com/package/@wcj/rollup-plugin-less)\n[![GitHub Actions Test](https://github.com/jaywcjlove/rollup-plugin-less/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/rollup-plugin-less/actions/workflows/ci.yml)\n\nA rollup plugin for [less](http://lesscss.org/) files.\n\n## Install\n\n```node\nnpm install @wcj/rollup-plugin-less --save\n```\n\n## Usage\n\n```js\nimport './test.less';\n// Generate css will be auto insert to the head tag if you set insert be true\n```\n\n```js\nimport { rollup } from 'rollup';\nimport resolve from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\nimport less from '@wcj/rollup-plugin-less';\n\nrollup({\n  input: 'src/main.js',\n  output: [\n    { name: 'Test', file: 'dist/test.cjs.js', format: 'cjs' },\n    { name: 'Test', file: 'dist/test.esm.js', format: 'esm' },\n    { name: 'Test', file: 'dist/test.js', format: 'umd' },\n    { name: 'Test', file: 'dist/test.min.js', format: 'umd' },\n  ],\n  plugins: [\n    less({\n      // PluginLessOptions: options....\n    }),\n    resolve(),\n    commonjs(),\n  ],\n});\n```\n\n## Options\n\n```ts\ninterface PluginLessOptions extends Less.Options {\n  /**\n   * Type: `String` | `RegExp` | `Array[...String|RegExp]`\n   * A valid [minimatch](https://www.npmjs.com/package/minimatch) pattern, or array of patterns.\n   * If options.include is omitted or has zero length, filter will return true by default.\n   * Otherwise, an ID must match one or more of the minimatch patterns,\n   * and must not match any of the options.exclude patterns.\n   * \u003e https://github.com/rollup/plugins/tree/master/packages/pluginutils#include-and-exclude\n   */\n  include?: FilterPattern,\n  /**\n   * Type: `String` | `RegExp` | `Array[...String|RegExp]`\n   * A valid [minimatch](https://www.npmjs.com/package/minimatch) pattern, or array of patterns.\n   * If options.include is omitted or has zero length, filter will return true by default.\n   * Otherwise, an ID must match one or more of the minimatch patterns,\n   * and must not match any of the options.exclude patterns.\n   * \u003e https://github.com/rollup/plugins/tree/master/packages/pluginutils#include-and-exclude\n   */\n  exclude?: FilterPattern,\n  /**\n   * https://github.com/rollup/plugins/tree/master/packages/pluginutils#options\n   */\n  options?: { resolve?: string | false | null },\n  /**\n   * If you specify a string, it will be the path to write the generated CSS.\n   * If you specify a function, call it passing the generated CSS as an argument.\n   */\n  output?: string | ((code: string, id:string) =\u003e string | Promise\u003cstring\u003e);\n  /**\n   * Add a banner to the string.\n   */\n  banner?: string;\n}\n```\n\nSet `Less.Options` in [`@types/less`](https://www.npmjs.com/package/@types/less)\n\n```ts\ndeclare namespace Less {\n  interface Options {\n    sourceMap?: SourceMapOption;\n    /** Filename of the main file to be passed to less.render() */\n    filename?: string;\n    /** The locations for less looking for files in @import rules */\n    paths?: string[];\n    /** True, if run the less parser and just reports errors without any output. */\n    lint?: boolean;\n    /** Pre-load global Less.js plugins */\n    plugins?: Plugin[];\n    /** @deprecated If true, compress using less built-in compression. */\n    compress?: boolean;\n    strictImports?: boolean;\n    /** If true, allow imports from insecure https hosts. */\n    insecure?: boolean;\n    depends?: boolean;\n    maxLineLen?: number;\n    /** @deprecated If false, No color in compiling. */\n    color?: boolean;\n    /** @deprecated False by default. */\n    ieCompat?: boolean;\n    /** @deprecated If true, enable evaluation of JavaScript inline in `.less` files. */\n    javascriptEnabled?: boolean;\n    /** Whether output file information and line numbers in compiled CSS code. */\n    dumpLineNumbers?: \"comment\" | string;\n    /** Add a path to every generated import and url in output css files. */\n    rootpath?: string;\n    /** Math mode options for avoiding symbol conficts on math expressions. */\n    math?: 'always' | 'strict' | 'parens-division' | 'parens' | 'strict-legacy' | number;\n    /** If true, stops any warnings from being shown. */\n    silent?: boolean;\n    /** Without this option, Less attempts to guess at the output unit when it does maths. */\n    strictUnits?: boolean;\n    /** Defines a variable that can be referenced by the file. */\n    globalVars?: {\n      [key: string] : string,\n    };\n    /** Puts Var declaration at the end of base file. */\n    modifyVars?: {\n      [key: string] : string,\n    };\n    /** Read files synchronously in Node.js */\n    syncImport?: boolean;\n  }\n}\n```\n\n## Development\n\n```bash\nnpm run watch # Listen compile .ts files.\nnpm run build # compile .ts files.\n\nnpm run test\n```\n\n## License\n\nMIT © [Kenny Wong](https://wangchujiang.com/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Frollup-plugin-less","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaywcjlove%2Frollup-plugin-less","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Frollup-plugin-less/lists"}