Plug-in installation for WeChat applet development tools (code support, syntax highlighting)
1. Install the easy compile extension
2. Environment configuration
If we don’t want to write wxss, but want to write less and scss, but less and scss were compiled into css before, then we can configure the settings in the vscode environment.
"easycompile.less": {
"outExt": ".wxss"
},
"easycompile.sass": {
"outExt": ".wxss"
},
3. Format files such as wxml
- Download plugin
- I want to take advantage of the prettier function and vscode environment configuration settings that I am already familiar with⬇
// 想要对wxml等文件进行格式化操作,想利用本身已经熟悉的prettier功能
"[wxml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[wxss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.documentSelectors": ["**/*.wxml", "**/*.wxss"]
Finally, in the root directory of the project, add the .prettierrc configuration file
{
"overrides": [
{
"files": "*.wxml",
"options": {
"parser": "html"
}
},
{
"files": "*.wxss",
"options": {
"parser": "css"
}
}
]
}