wooorm / refractor

Lightweight, robust, elegant virtual syntax highlighting using Prism

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sideEffects: false incorrect

pfgithub opened this issue · comments

commented

all.js and common.js have side effects that get deleted when tree-shaking because of this option in package.json

commented

which parts?

commented

all.js and common.js remove all their language imports and end up registering nothing except plaintext. I think the correct option for sideEffects is

"sideEffects": ["lib/all.js", "lib/common.js"],
commented

Could you check by changing the package.json in your node_modules locally which configuration works for your bundler (and share what bundler that is)?
I’m up for changing this but I’d appreciate publishing something more certain than an “I think X will work”!

commented

It works with "sideEffects": ["lib/all.js", "lib/common.js"],. I tested and

  • the bundle size is large, as expected, rather than being tiny
  • getLanguages returns the full language list
  • languages seem to work.
commented

Could you clarify which bundler that is?

commented

I'm using vite which uses rollup internally

commented

released!