2.9.0 • Published 8 years ago

tpack-less v2.9.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

tpack-less

TPack 插件:使用 lesscss 编译 LESS。

安装

$ npm install tpack-less -g

使用

编译 LESS 并重命名为 CSS

tpack.src("*.less").pipe(tpack.plugin("tpack-less"));

源映射(Source Map)

本插件可生成源映射,具体用法见 源映射

配置

tpack.src("*.less").pipe(tpack.plugin("tpack-less"), {
    env: "development",             // 当前生成环境。"development":开发环境;"production":生产环境。
    logLevel: 2,                    // 日志等级。0:不输出日志。1:仅错误。2:错误和信息。
    async: false,                   // 是否采用异步加载。 [1]
    sourceMap: true,                // 是否生成源映射。 [1]
    filename: "",                   // 源文件名。 [1]
    paths: [],                      // 导入全局搜索路径。 
    syncImport: true ,              // 是否使用同步导入模块。 [1]
    relativeUrls: true,             // 是否使用相对地址。[1]
    compress: false,                // 是否压缩输出代码。[1]
    fileAsync: false,               // 是否同步加载文件。 [1]
    poll: 1000,                     // 监听模式下的等待时间。
    functions: {},                  // 自定义函数。
    dumpLineNumbers: null,          // 是否记录行号。 "comments" 表示通过注释记录。
    globalVars: { },                // Less 内部全局变量。如 { var1: '"string value"'}。
    rootpath: null,                 // 内部地址使用的跟路径。如 ":/a.com/"。
    useFileCache: true,             // 是否使用文件缓存。
    modifyVars: { },                // 强制覆盖 Less 内部全局变量。如 { var1: '"string value"'}。
    errorReporting: "console",      // 错误报告方式。
});

1: 插件内部已重设了此配置的默认值。

另参考 http://lesscss.org/usage/index.html

2.9.0

8 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago