When developing small programs natively, I don’t like writing WXSS, I like writing Stylus.

The command-line tool wxSS-transform was developed

You can process directory A and output it to directory B

The processing here is to convert the stylus and CSS files to WXSS

And after the startup, it will always listen to directory A

Project address: github.com/tingzhong66…

The installation

npm i -D|-g wxss-transform
Copy the code

use

npx wxss ./src ./dist
Copy the code
  • Before using

  • After using
    • No parameter, default is to listen on the project./srcAnd the output to the./dist

Rely on

{
    "chokidar": "^ 3.0.0"."postcss-cli": "^ 6.1.2." "."postcss-mpvue-wxss": "^ 1.0.2"."stylus": "^ 0.54.5"
  }
Copy the code

In fact, it is a combination of other people’s conversion tools, and then listen to the file

If you’re interested, you can play with this tool