Open taylorhadden opened 1 year ago
Removing "type": "module"
breaks all building scripts (obvious, in retrospect).
I was able to get importing & building to work by adding a package.json
with nothing but { "type": "commonjs" }
in the ./lib/
folder.
I was also unable to use version 0.7.16 due to this issue. 0.7.15 works.
With 0.7.16, attempts to import Typewriter's modules (in a typical Svelte + Typescript project) resulted in an error along the lines of "exports is not defined".
The 0.7.16 is broken - I am getting Uncaught ReferenceError: exports is not defined
on a clean npx create-vite
project.
I am in the process of updating typewriter to 0.7.16 in my project. With the switch to using a commonjs output, webpack cannot import from sub-directories (e.g.
import { h } from 'typewriter-editor/lib/rendering/vdom'
).I was able to fix this by removing
"type": "module"
inpackage.json
. Looks like typewriter needs to be a commonjs module through-and-through or the js files it produces need to be .cjs.