Configure package exports explicitly (#336)

Closes #337
Blocks https://github.com/webrecorder/archiveweb.page/issues/198

Adds a dedicated `misc` export, as well as explicitly exporting the
`electron-*` files and the `index.html` file. This restricts imports to
only these files, and allows us to not have to exactly match webpack
configs between RWP and AWP.
This commit is contained in:
Emma Segal-Grossman
2024-06-18 21:41:21 -04:00
committed by GitHub
parent 2700797b6a
commit 1feee354c7
4 changed files with 102 additions and 5 deletions
+12 -2
View File
@@ -7,8 +7,18 @@
"homepage": "https://replayweb.page/",
"author": "Webrecorder Software",
"license": "AGPL-3.0-or-later",
"main": "ui.js",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"default": "./ui.js"
},
"./misc": {
"types": "./dist/types/misc.d.ts",
"default": "./dist/misc.js"
},
"./src/electron-*": "./src/electron-*.ts",
"./index.html": "./index.html"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"@shoelace-style/shoelace": "~2.15.1",