Files
modeling-app/packages/codemirror-lang-kcl/rollup.config.js
Jonathan Tran 3c53babb50 Move the base CodeMirror KCL support to a local package (#4897)
* Move CodeMirror LRLanguage to new file

This separates the base language support from the LSP and color picker.

* Move the base CodeMirror KCL support to a local package

* Start CodeMirror grammar tests

* Exclude vitest config in tsconfig

* Add KCL path to tsconfig

* Remove stray import

* Drop extension from import

* Use __filename for commonjs compat

* Check exec return before access

* Build ES and CJS to dist

* Format

* Exclude all.test.ts from codespell

This is to work around "fileTests" imported from Lezer. Future codespell versions look
like they'll allow the code to be annotated, which would be nicer.

---------

Co-authored-by: Matt Mundell <matt@mundell.me>
2025-01-04 10:57:24 -08:00

26 lines
759 B
JavaScript

import dts from 'rollup-plugin-dts'
import { lezer } from '@lezer/generator/rollup'
import typescript from '@rollup/plugin-typescript'
export default [
{
input: 'src/index.ts',
// imports are considered internal if they start with './' or '/' or 'word:'
external: (id) => id != 'tslib' && !/^(\.?\/|\w:)/.test(id),
output: [
{ file: 'dist/index.cjs', format: 'cjs' },
{ file: 'dist/index.js', format: 'es' },
],
plugins: [lezer(), typescript()],
},
{
input: 'src/index.ts',
external: (id) => id != 'tslib' && !/^(\.?\/|\w:)/.test(id),
output: [
{ file: 'dist/index.d.cts', format: 'cjs' },
{ file: 'dist/index.d.ts', format: 'es' },
],
plugins: [lezer(), typescript(), dts()],
},
]