codejar
codejar copied to clipboard
Typescript incompatible with latest Rollup plugins
I've been using Codejar in a Svelte project and recently tried to update all of my @rollup/plugin libraries. However, I noticed that updating either @rollup/plugin-commonjs or @rollup/plugin-node-resolve resulted in the following typescript error from Codejar:
[!] (plugin commonjs--resolver) Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
node_modules/codejar/codejar.ts (3:5)
1: const globalWindow = window
2:
3: type Options = {
^
4: tab: string
5: indentOn: RegExp
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
at error (/Users/tuckergordon/Desktop/svelte-typescript-app/node_modules/rollup/dist/shared/rollup.js:198:30)
at Module.error (/Users/tuckergordon/Desktop/svelte-typescript-app/node_modules/rollup/dist/shared/rollup.js:12553:16)
at Module.tryParse (/Users/tuckergordon/Desktop/svelte-typescript-app/node_modules/rollup/dist/shared/rollup.js:12930:25)
at Module.setSource (/Users/tuckergordon/Desktop/svelte-typescript-app/node_modules/rollup/dist/shared/rollup.js:12835:24)
at ModuleLoader.addModuleSource (/Users/tuckergordon/Desktop/svelte-typescript-app/node_modules/rollup/dist/shared/rollup.js:22309:20)
I have created a repository that demonstrates this issue. None of the other libraries that I'm using in my project (not included in this sample repo) have this issue, which is what leads me to believe it's a problem with Codejar.
The issue occurs when updating between these versions of the libraries:
Working versions
"@rollup/plugin-commonjs": "21.0.1",
"@rollup/plugin-node-resolve": "13.2.1",
Broken versions
"@rollup/plugin-commonjs": "22.0.0",
"@rollup/plugin-node-resolve": "13.3.0",
I don't see anything in either of their CHANGELOGs (here and here) that would've caused this but maybe I'm missing something?