npm.io
2.1.15 • Published 2 years ago

tsl-cli-helper

Licence
ISC
Version
2.1.15
Deps
45
Size
92 kB
Vulns
4
Weekly
0

介绍


特性

tsl-cli-helper 为 tsl-cli 服务和能力扩展,支持的能力如下:

  • 支持预编译 vue 组件
  • 支持预编译 ts 文件
  • 支持预编译 less/sass 文件
  • babel preset 的基础配置

支持环境

  • macos
  • windows
  • linux
api
import { style, script, vue, webpack } from "tsl-cli-helper";
// 其它代码
style
  • compileFile(filePath: string, postcssConfig?: postcssrc.Result) => Promise<string>
    • filepath 文件路径
    • postcssConfig: postcss.config 的自定义配置
script
  • compileFile(filePath: string, config?: TransformOptions) => Promise<string>
    • filepath 文件路径
    • config: babel.config 的自定义配置
webpack
  • devServer(type: "studio", config: any)

    • type 项目类型
    • config webpack 配置
  • compile(type: "studio" | "uc" | "library", options: { src?: string; out?: string }, config: any)

    • type 项目类型
    • options 输入输出配置
    • config webpack 配置