You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
field, with katex/dist/katex.mjs existing already? Is #1653 (which partially reverted #1479) still a problem or can the field be (re)added.
If there aren't any build problems, ideally katex as a esm would be something like this: master...BrianHung:es6-modules where
import{renderToString}from"katex"
could work for tree-shaking with es6 modules and transpiling back to cjs without build errors.
For further context, an issue I'm running into using katex is with that above line. Currently, transpiling (into cjs and es6) and bundling a file that uses that line with webpack is fine without any build errors, but results in the entire katex.js being included as a chunk without being tree-shaken.
but that results in a build error when trying to transpile katex.mjs back into cjs:
> Build error occurred
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/brian/threads/node_modules/katex/dist/katex.mjs
at Module.load (internal/modules/cjs/loader.js:1047:11)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there any reason why katex doesn't have a
field, with
katex/dist/katex.mjs
existing already? Is #1653 (which partially reverted #1479) still a problem or can the field be (re)added.If there aren't any build problems, ideally katex as a esm would be something like this: master...BrianHung:es6-modules where
could work for tree-shaking with es6 modules and transpiling back to cjs without build errors.
For further context, an issue I'm running into using katex is with that above line. Currently, transpiling (into cjs and es6) and bundling a file that uses that line with webpack is fine without any build errors, but results in the entire
katex.js
being included as a chunk without being tree-shaken.I tried using a shim
but that results in a build error when trying to transpile
katex.mjs
back intocjs
:Beta Was this translation helpful? Give feedback.
All reactions