wooorm / refractor

Lightweight, robust, elegant virtual syntax highlighting using Prism
MIT License
724 stars 34 forks source link

sideEffects: false incorrect #48

Closed pfgithub closed 3 years ago

pfgithub commented 3 years ago

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

wooorm commented 3 years ago

which parts?

pfgithub commented 3 years ago

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"],
wooorm commented 3 years ago

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”!

pfgithub commented 3 years ago

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

wooorm commented 3 years ago

Could you clarify which bundler that is?

pfgithub commented 3 years ago

I'm using vite which uses rollup internally

wooorm commented 3 years ago

released!