首页 > 其他分享 >tsc编译less | typescript编译less

tsc编译less | typescript编译less

时间:2022-10-19 09:35:37浏览次数:73  
标签:文件 typescript less -- tsc 编译 pnpm

tsc-less

众所周知,Typescript编译器在编译.ts文件时不会处理.less文件,在我们使用tsc编译的.js文件中,代码中.less后缀没有更改,且less文件也没有被复制到编译的文件夹中。tsc-less可以帮助您将编译后的代码中的.less改为.css后缀,并且可以把less文件复制到编译的文件中。

在这里插入图片描述

安装

我们建议您使用包管理器 (NPM,Yarn, pnpm 安装 tsc-less

# 选择一个你喜欢的包管理器

# NPM
$ npm install tsc-less -D

# Yarn
$ yarn add tsc-less

# pnpm
$ pnpm install tsc-less

添加命令到package.json

"scripts": {
  "build": "tsc -p tsconfig.json && tsc-less -i ./inputFiles -o ./outputFiles",
}

Options

flag description
-i --in tsc编译的源码路径,如您文件的src、packages
-o --out tsc编译输出路径 (tsc --outDir)

License

MIT

标签:文件,typescript,less,--,tsc,编译,pnpm
From: https://www.cnblogs.com/wangyongcun/p/16805048.html

相关文章

  • Linux 源码编译安装实现LAMP架构
    1.apache服务编译安装https://www.cnblogs.com/heyongshen/p/16803125.html说明:  编译安装默认不支持fastcgi功能和反向代理功能相关配置:  开启fastcgi功能和反向......
  • linux 内核编译问题汇总
    一、编译设备树时找不到设备树包含的头文件设备树包中包含的头文件会到kernel/scripts/dtc/include-prefixes/dt-bindings目录下去查找(新版本内核),而dt-bindings目录......
  • [!Typescript] Tips: Access deeper parts of objects and arrays
    AccessingobjectvaluesandarraymembersisMUCHmorepowerfulinthetypeworldthanitisintheruntimeworld.Passingaunion...RETURNSaunion!interfac......
  • IDEA里编译报错提示常量字符串过长
    问题从数据库查出某字段(text类型)数据,通过编写程序解析转换做处理,程序编写完成编译时报错:Error:java:常量字符串过长解决查询资料发现,原因是javac在编译期间,常量字......
  • [Typescript] 56. Medium - Flip Arguments
    Implementthetypeversionoflodash's _.flip.Type FlipArguments<T> requiresfunctiontype T andreturnsanewfunctiontypewhichhasthesamereturnty......
  • [Typescript] 55. Medium - Reverse
    Implementthetypeversionof Array.reverseForexample:typea=Reverse<['a','b']>//['b','a']typeb=Reverse<['a','b','c']>//['c','b',......
  • Serverless 遇到 FinOps: Economical Serverless
    Serverless遇到FinOps:EconomicalServerless**摘要:**本文基于FunctionGraph在Serverless领域的FinOps探索和实践,提出业界首个Serverless函数总成本估计模型......
  • Serverless 遇到 FinOps: Economical Serverless
    Serverless遇到FinOps:EconomicalServerless摘要:本文基于FunctionGraph在Serverless领域的FinOps探索和实践,提出业界首个Serverless函数总成本估计模型Key......
  • 交叉编译器的制作教程
    ———————————————————————————————————————主机操作系统:Centos6.7 交叉编译器环境:arm-linux-gcc-4.5.4 Linux内核版本:linux-3.0......
  • 《Vue3.x+TypeScript实践指南》已出版
    转眼回长沙快2年了,图书本在去年就已经完稿,因为疫情,一直耽搁了,直到这个月才出版!疫情之下,众生皆苦!感觉每天都是吃饭、睡觉、上班、做核酸!图书介绍为了紧跟技......