diff --git a/scripts/sdk/base-manifest.json b/scripts/sdk/base-manifest.json index bc8919fb..666cc2b9 100644 --- a/scripts/sdk/base-manifest.json +++ b/scripts/sdk/base-manifest.json @@ -2,14 +2,7 @@ "name": "hydrogen-view-sdk", "description": "Embeddable matrix client library, including view components", "version": "0.0.2", - "main": "./hydrogen.cjs.js", - "exports": { - ".": { - "import": "./hydrogen.es.js", - "require": "./hydrogen.cjs.js" - }, - "./paths/vite": "./paths/vite.js", - "./style.css": "./style.css" - }, "types": "types/lib.d.ts" + "main": "./hydrogen.es.js", + "type": "module" } diff --git a/scripts/sdk/create-manifest.js b/scripts/sdk/create-manifest.js old mode 100755 new mode 100644 index 7a01de0a..cf2e360c --- a/scripts/sdk/create-manifest.js +++ b/scripts/sdk/create-manifest.js @@ -1,7 +1,22 @@ #!/usr/bin/env node const fs = require("fs"); -const appManifest = require("../../package.json") -const baseSDKManifest = require("./base-manifest.json") +const appManifest = require("../../package.json"); +const baseSDKManifest = require("./base-manifest.json"); +/* + need to leave exports out of base-manifest.json because of #vite-bug, + with the downside that we can't support environments that support + both esm and commonjs modules, so we pick just esm. + ``` + "exports": { + ".": { + "import": "./hydrogen.es.js", + "require": "./hydrogen.cjs.js" + }, + "./paths/vite": "./paths/vite.js", + "./style.css": "./style.css" + }, + ``` +*/ const mergeOptions = require('merge-options'); const manifestExtension = {