diff --git a/package.json b/package.json
index b6299896..1efafb16 100644
--- a/package.json
+++ b/package.json
@@ -27,9 +27,12 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.29.2",
+ "acorn": "^8.6.0",
+ "acorn-walk": "^8.2.0",
"aes-js": "^3.1.2",
"core-js": "^3.6.5",
"es6-promise": "https://github.com/bwindels/es6-promise.git#bwindels/expose-flush",
+ "escodegen": "^2.0.0",
"eslint": "^7.32.0",
"fake-indexeddb": "^3.1.2",
"impunity": "^1.0.9",
diff --git a/scripts/sdk/base-manifest.json b/scripts/sdk/base-manifest.json
index d8e30dd2..90061a4b 100644
--- a/scripts/sdk/base-manifest.json
+++ b/scripts/sdk/base-manifest.json
@@ -3,8 +3,11 @@
"version": "0.0.1",
"main": "./hydrogen.cjs.js",
"exports": {
- "import": "./hydrogen.es.js",
- "require": "./hydrogen.cjs.js"
+ ".": {
+ "import": "./hydrogen.es.js",
+ "require": "./hydrogen.cjs.js"
+ },
+ "./paths/vite": "./paths/vite.js"
},
"types": "types/lib.d.ts"
}
diff --git a/scripts/sdk/build.sh b/scripts/sdk/build.sh
old mode 100644
new mode 100755
index c9f7a79d..c22eb4ec
--- a/scripts/sdk/build.sh
+++ b/scripts/sdk/build.sh
@@ -3,6 +3,8 @@ yarn run vite build -c vite.sdk-assets-config.js
yarn run vite build -c vite.sdk-lib-config.js
yarn tsc -p tsconfig-declaration.json
./scripts/sdk/create-manifest.js ./target/package.json
+mkdir target/paths
+./scripts/sdk/transform-paths.js ./src/platform/web/sdk/paths/vite.js ./target/paths/vite.js
pushd target
pushd asset-build/assets
mv main.*.js ../../main.js
diff --git a/scripts/sdk/transform-paths.js b/scripts/sdk/transform-paths.js
new file mode 100755
index 00000000..60724c21
--- /dev/null
+++ b/scripts/sdk/transform-paths.js
@@ -0,0 +1,36 @@
+#!/usr/bin/env node
+
+/**
+This script transforms the string literals in the sdk path files to adjust paths
+from what they are at development time to what they will be in the sdk package.
+
+It does this by looking in all string literals in the paths file and looking for file names
+that we expect and need replacing (as they are bundled with the sdk).
+
+Usage: ./transform-paths.js