https://github.com/illright/unplugin-lezer
Universal plugin to import Lezer grammar files
https://github.com/illright/unplugin-lezer
esbuild grammar lezer rollup unplugin vite webpack
Last synced: about 1 year ago
JSON representation
Universal plugin to import Lezer grammar files
- Host: GitHub
- URL: https://github.com/illright/unplugin-lezer
- Owner: illright
- License: mit
- Created: 2023-11-08T16:51:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T21:25:52.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T09:13:23.442Z (over 1 year ago)
- Topics: esbuild, grammar, lezer, rollup, unplugin, vite, webpack
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/unplugin-lezer
- Size: 200 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unplugin-lezer
[](https://www.npmjs.com/package/unplugin-lezer)
Universal plugin to import [Lezer](https://lezer.codemirror.net/) grammar files.
## Install
```bash
npm i unplugin-lezer
```
Vite
```ts
// vite.config.ts
import lezer from 'unplugin-lezer/vite'
export default defineConfig({
plugins: [
lezer(),
],
})
```
Example: [`playground/`](./playground/)
Rollup
```ts
// rollup.config.js
import lezer from 'unplugin-lezer/rollup'
export default {
plugins: [
lezer(),
],
}
```
Webpack
```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-lezer/webpack')()
]
}
```
Vue CLI
```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-lezer/webpack')(),
],
},
}
```
esbuild
```ts
// esbuild.config.js
import { build } from 'esbuild'
import lezer from 'unplugin-lezer/esbuild'
build({
plugins: [lezer()],
})
```