cd007b40e1
Fix https://github.com/vector-im/hydrogen-web/issues/686 Fix https://github.com/vector-im/hydrogen-web/issues/682 Instead of deleting the whole `target/` directory, leave it alone so the symlink driving the `npm link`/`yarn link` stays in tact. Leave Vite builds in their build directories (`/lib-build`/`/asset-build`) so you can `vite build --watch` to build on local changes and still have a consisent place to reference in the `package.json` `exports`. Previously, everything relied on `build.sh` which does a bunch of moving and renaming and made it hard to rebuild on changes. Add back support for CommonJS (adding the `package.json` `exports`). The last piece is making sure the `?url` imports (`import workerPath from 'hydrogen-view-sdk/main.js?url';`) work still. It looks like this may have just been solved via https://github.com/vitejs/vite/issues/6725 -> https://github.com/vitejs/vite/pull/7073 (literally 2 days ago) and we just need to wait for the next Vite release 🎉
18 lines
647 B
JSON
18 lines
647 B
JSON
{
|
|
"name": "hydrogen-view-sdk",
|
|
"description": "Embeddable matrix client library, including view components",
|
|
"version": "0.0.5",
|
|
"main": "./hydrogen.cjs.js",
|
|
"exports": {
|
|
".": {
|
|
"import": "./lib-build/hydrogen.es.js",
|
|
"require": "./lib-build/hydrogen.cjs.js"
|
|
},
|
|
"./paths/vite": "./paths/vite.js",
|
|
"./style.css": "./asset-build/assets/index.css",
|
|
"./main.js": "./asset-build/assets/download-sandbox.html",
|
|
"./download-sandbox.html": "./asset-build/assets/download-sandbox.html",
|
|
"./assets/*": "./asset-build/assets/*"
|
|
},
|
|
"type": "module"
|
|
}
|