Skip to content

Commit

Permalink
feat(vscode): disable config
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jun 30, 2022
1 parent 307417e commit 71cc74b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/vscode/package.json
Expand Up @@ -39,6 +39,11 @@
"type": "object",
"title": "UnoCSS",
"properties": {
"unocss.disable": {
"type": "boolean",
"default": false,
"description": "Disable the UnoCSS extension"
},
"unocss.root": {
"type": "string",
"description": "Project root that contains the UnoCSS configuration file"
Expand Down
4 changes: 4 additions & 0 deletions packages/vscode/src/index.ts
Expand Up @@ -13,6 +13,10 @@ export async function activate(ext: ExtensionContext) {
return

const config = workspace.getConfiguration('unocss')
const disabled = config.get<boolean>('disable', false)
if (disabled)
return

const root = config.get<string>('root')
const cwd = root ? path.resolve(projectPath, root) : projectPath

Expand Down

0 comments on commit 71cc74b

Please sign in to comment.