-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Describe the issue/behavior that seems buggy
The ESM build does not export named exports.
The highlight code links to the Node docs on how to setup an ESM build:
highlight.js/tools/build_node.js
Line 11 in bd548da
// https://nodejs.org/api/packages.html#packages_writing_dual_packages_while_avoiding_or_minimizing_hazards |
However, it does not appear to follow the instructions mentioned there.
In my experience, the wrapper approach mentioned in the Node docs doesn't work all that well compared to having Rollup output both formats. I see you're already using Rollup. Is there any reason you don't have it output CJS and ESM instead of creating a wrapper?
Sample Code or Instructions to Reproduce
npm install --save highlight.js
cat node_modules/highlight.js/es/core.js
Expected behavior
The individual functions like highlight
and registerLanguage
should be exported in addition to the default export
Additional context
I can't get highlight to work in SvelteKit / Vite without workarounds (metonym/svelte-highlight#158)