https://github.com/reececomo/ifdef-loader-syntax-highlighting
Syntax highlighting for ifdef-loader conditional compilation comments in TypeScript and JavaScript files.
https://github.com/reececomo/ifdef-loader-syntax-highlighting
Last synced: 4 months ago
JSON representation
Syntax highlighting for ifdef-loader conditional compilation comments in TypeScript and JavaScript files.
- Host: GitHub
- URL: https://github.com/reececomo/ifdef-loader-syntax-highlighting
- Owner: reececomo
- License: mit
- Created: 2025-10-15T08:36:10.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-15T08:54:57.000Z (9 months ago)
- Last Synced: 2025-10-15T23:50:54.224Z (9 months ago)
- Size: 90.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ifdef-loader Syntax Highlighting
[](https://marketplace.visualstudio.com/items?itemName=reececomo.ifdef-loader-syntax-highlighting)
[](LICENSE)
Syntax highlighting for [**ifdef-loader**](https://www.npmjs.com/package/ifdef-loader) conditional compilation comments.
- ✅ Supports built-ins: `#if`, `#else`, `#elif`, `#endif`
- ✅ Supports `#code` uncomment prefix blocks (and custom prefixes)
- 🟡 Not supported: `"ifdef-triple-slash": false`

### Recommended: Enable block highlighting
Configure block highlights - e.g. using the [**Highlight extension**](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-highlight):
#### .vscode/settings.json:
```json
{
"highlight.regexes": {
"( *\/\/\/ #if.*)((?:.|\n)*?\n)( *\/\/\/ #endif)": {
"filterFileRegex": ".*\\.(?:jsx?|tsx?)$",
"regexFlags": "gm",
"decorations": [
{},
{
"isWholeLine": true,
"dark": { "backgroundColor": "#ffa81d28" },
"light": { "backgroundColor": "#ffa81d10" }
},
{}
]
},
"( *\/\/\/ )(#(?:if|elif|else|endif))": {
"filterFileRegex": ".*\\.(?:jsx?|tsx?)$",
"decorations": [
{
"isWholeLine": true,
"dark": { "backgroundColor": "#ffa81d26" },
"light": { "backgroundColor": "#ffa81d20" }
},
{
"fontWeight": "600"
}
]
}
}
}
```
## Build & install
```sh
git clone git@github.com:reececomo/ifdef-loader-syntax-highlighting
cd ifdef-loader-syntax-highlighting
npm run build
npm run install-extension
```