Skip to content

💅 Replace the .scss or .less suffix in the js file generated by tsc with .css

License

Notifications You must be signed in to change notification settings

vortesnail/tsccss

Repository files navigation

tsccss npm npm

As we all know, Typescript compiler does not process .scss or .less files when compiling .ts files, we usually use node-sass or less to process them. But in our compiled .js files the style file suffixes are not changed, tsccss can help you change them all to .css suffixes without worrying about replacing them in other places you don't want to, this tool is based on AST, not Regular Expressions.

Getting Started

First, install tsccss as devDependency using npm or yarn.

npm install tsccss --save-dev
# or
yarn add tsccss -D

Add it to your build scripts in package.json

"scripts": {
  "build": "tsc -p tsconfig.json && tsccss -o ./out",
}

Options

flag description
-o --out output directory of transpiled code (tsc --outDir)

You need to provide -o (--out), this is the root folder where you need to do the style suffix replacement.

License

MIT

About

💅 Replace the .scss or .less suffix in the js file generated by tsc with .css

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published