Closed emergence75 closed 1 year ago
I'll look into this, thanks for creating an issue
@emergence75 Please take a look. I've pushed a possible fix out, did this fix the issue you were having?
just testet...
same problem...
Initialized 🚀✨
Bundling 🚀
Fetch https://unpkg.com/codemirror@latest Fetch https://unpkg.com/@codemirror/lang-javascript@latest Fetch https://unpkg.com/@codemirror/language@%5E6.6.0 Fetch https://unpkg.com/@codemirror/state@%5E6.0.0 Fetch https://unpkg.com/@lezer/javascript@%5E1.0.0 Fetch https://unpkg.com/@lezer/common@%5E1.0.0 Fetch https://unpkg.com/@codemirror/autocomplete@%5E6.0.0 Fetch https://unpkg.com/@codemirror/language@%5E6.0.0 Fetch https://unpkg.com/@codemirror/view@%5E6.0.0 Fetch https://unpkg.com/@codemirror/view@%5E6.6.0 Fetch https://unpkg.com/style-mod@%5E4.0.0 Fetch https://unpkg.com/@lezer/lr@%5E1.3.0 Fetch https://unpkg.com/@codemirror/state@%5E6.1.4 Fetch https://unpkg.com/w3c-keyname@%5E2.2.4 Fetch https://unpkg.com/@lezer/highlight@%5E1.0.0 Fetch https://unpkg.com/@lezer/highlight@%5E1.1.3 Fetch https://unpkg.com/@codemirror/lint@%5E6.0.0 Fetch https://unpkg.com/@codemirror/search@%5E6.0.0 Fetch https://unpkg.com/@codemirror/commands@%5E6.0.0 Fetch https://unpkg.com/@codemirror/state@%5E6.2.0
Fetch https://unpkg.com/crelt@%5E1.0.5
Done ✨
Ok, I'll do some more research on this
This should provide context on what I think the error is here https://github.com/okikio/bundlejs/issues/43#issuecomment-1455547451
I now have a fix, I'll try to get it out by tmrw
@emergence75 Take a look https://stackblitz.com/edit/vitejs-vite-iquaht?file=src%2Fmain.ts&terminal=dev
very cool ;-)
I've not yet added the fix to the bundlejs.com website but as you can see it's now fixed and the fix should be published soon
I forgot to update this issue, I already added support for this on the bundlejs website, so this should be fixed everywhere now
just tried the tool on https://bundlejs.com/
with option set "format": "iife", "minify": false,
using this logic descriped here to build a codemirror 6 https://codemirror.net/examples/bundle/
import {EditorView, basicSetup} from "codemirror" import {javascript} from "@codemirror/lang-javascript"
let editor = new EditorView({ extensions: [basicSetup, javascript()], parent: document.body })
when building the console brings me Bundling 🚀
Fetch https://unpkg.com/@codemirror/lang-javascript@latest Fetch https://unpkg.com/codemirror@latest Fetch https://unpkg.com/@lezer/common@%5E1.0.0 Fetch https://unpkg.com/@lezer/javascript@%5E1.0.0 Fetch https://unpkg.com/@codemirror/language@%5E6.6.0 Fetch https://unpkg.com/@codemirror/state@%5E6.0.0 Fetch https://unpkg.com/@codemirror/view@%5E6.0.0 Fetch https://unpkg.com/@codemirror/autocomplete@%5E6.0.0 Fetch https://unpkg.com/@codemirror/lint@%5E6.0.0 Fetch https://unpkg.com/@codemirror/language@%5E6.0.0 Fetch https://unpkg.com/@codemirror/commands@%5E6.0.0 Fetch https://unpkg.com/@codemirror/search@%5E6.0.0 Fetch https://unpkg.com/@lezer/highlight@%5E1.1.3 Fetch https://unpkg.com/@lezer/lr@%5E1.3.0 Fetch https://unpkg.com/@codemirror/view@%5E6.6.0 Fetch https://unpkg.com/w3c-keyname@%5E2.2.4 Fetch https://unpkg.com/@codemirror/state@%5E6.1.4 Fetch https://unpkg.com/style-mod@%5E4.0.0 Fetch https://unpkg.com/crelt@%5E1.0.5 Fetch https://unpkg.com/@codemirror/state@%5E6.2.0 Fetch https://unpkg.com/@lezer/highlight@%5E1.0.0
Done ✨
the problem with this is, that multiple versions e.g state or view are also included and the generated codemirror js does not work... testing the generated code brings Uncaught Error: Unrecognized extension value in extension set ([object Object]). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.
by the way, cool project...