Prefix Codemirror/Language js files

Hello,

I am use the @codemirror/language-data package. The package is fantastic and I’m not having any problems using it. – My app is a PWA, and thus installs all .js files to a service-worker.

I would like to ignore files from CodeMirror, because there are so many languages. However, unlike packages like prism.js, CodeMirror syntax files are not prefixed (imagine like cm-clike or cm-java). Thus, it makes it very hard to target them using an ignore-glob pattern.

Is there a way to prefix these js files, or if known a way to directly ignore when installing in a PWA? For context, it is a VitePWA so technically using Rollup under the hood AFAIK.

Below is an image of what it looks like when you install code mirror files to the service worker. They’re individually fast, but because there’s so many, it takes up to 30 seconds for the site to become a fully installable PWA which is not ideal.

I don’t know VitePWA but it seems that if you’re creating the chunks, you are the one who’s in control of their naming.

(From the screenshot): clike, clojure, etc… are from legacy mode.

i.e. I don’t control the pertinent part of their name. The library does.

Is there a way I can hook into or change however these are packaged so that the names would be like cm-clojure-HASH. instead of clojure-HASH

For anyone else that runs into this. I just used a vim macro to create all the globs lol

"**\/apl-**",          "**\/css-**",          "**\/factor-**",       "**\/javascript-**",   "**\/nginx-**",        "**\/puppet-**",       "**\/simple-mode-**",  "**\/tiki-**",         "**\/webidl-**", 
"**\/asciiarmor-**",   "**\/cypher-**",       "**\/fcl-**",          "**\/jinja2-**",       "**\/nsis-**",         "**\/python-**",       "**\/smalltalk-**",    "**\/toml-**",         "**\/xml-**", 
"**\/asn1-**",         "**\/d-**",            "**\/forth-**",        "**\/julia-**",        "**\/ntriples-**",     "**\/q-**",            "**\/solr-**",         "**\/troff-**",        "**\/xquery-**", 
"**\/asterisk-**",     "**\/diff-**",         "**\/fortran-**",      "**\/livescript-**",   "**\/octave-**",       "**\/r-**",            "**\/sparql-**",       "**\/ttcn-cfg-**",     "**\/yacas-**", 
"**\/brainfuck-**",    "**\/dockerfile-**",   "**\/gas-**",          "**\/lua-**",          "**\/oz-**",           "**\/rpm-**",          "**\/spreadsheet-**",  "**\/ttcn-**",         "**\/yaml-**", 
"**\/clike-**",        "**\/dtd-**",          "**\/gherkin-**",      "**\/mathematica-**",  "**\/pascal-**",       "**\/ruby-**",         "**\/sql-**",          "**\/turtle-**",       "**\/z80-**", 
"**\/clojure-**",      "**\/dylan-**",        "**\/go-**",           "**\/mbox-**",         "**\/pegjs-**",        "**\/rust-**",         "**\/stex-**",         "**\/vb-**", 
"**\/cmake-**",        "**\/ebnf-**",         "**\/groovy-**",       "**\/mirc-**",         "**\/perl-**",         "**\/sas-**",          "**\/stylus-**",       "**\/vbscript-**", 
"**\/cobol-**",        "**\/ecl-**",          "**\/haskell-**",      "**\/mllike-**",       "**\/pig-**",          "**\/sass-**",         "**\/swift-**",        "**\/velocity-**", 
"**\/coffeescript-**", "**\/eiffel-**",       "**\/haxe-**",         "**\/modelica-**",     "**\/powershell-**",   "**\/scheme-**",       "**\/tcl-**",          "**\/verilog-**", 
"**\/commonlisp-**",   "**\/elm-**",          "**\/http-**",         "**\/mscgen-**",       "**\/properties-**",   "**\/shell-**",        "**\/textile-**",      "**\/vhdl-**", 
"**\/crystal-**",      "**\/erlang-**",       "**\/idl-**",          "**\/mumps-**",        "**\/protobuf-**",     "**\/sieve-**",        "**\/tiddlywiki-**",   "**\/wast-**",