diff --git a/packages/fxa-auth-client/.cjs.package.json b/packages/fxa-auth-client/.cjs.package.json new file mode 100644 index 00000000000..69f62749943 --- /dev/null +++ b/packages/fxa-auth-client/.cjs.package.json @@ -0,0 +1,13 @@ +{ + "name": "fxa-auth-client", + "type": "commonjs", + "exports": { + ".": "./server.js", + "./lib/client": "./client.js", + "./lib/crypto": "./lib/crypto.js", + "./lib/hawk": "./lib/hawk.js", + "./lib/recoveryKey": "./lib/recoveryKey.js", + "./lib/utils": "./lib/utils.js", + "./lib/*": "./lib/*.js" + } +} diff --git a/packages/fxa-auth-client/package.json b/packages/fxa-auth-client/package.json index 0ab38382941..cc4ca6222c7 100644 --- a/packages/fxa-auth-client/package.json +++ b/packages/fxa-auth-client/package.json @@ -35,7 +35,7 @@ "scripts": { "lint": "eslint . --ext .ts", "postinstall": "(tsc --build tsconfig.browser.json && tsc --build) || true", - "build": "tsc --build tsconfig.browser.json && tsc --build && tsc --build tsconfig.cjs.json && echo '{ \"type\": \"commonjs\" }' > ./dist/server/cjs/packages/fxa-auth-client/package.json", + "build": "tsc --build tsconfig.browser.json && tsc --build && tsc --build tsconfig.cjs.json && cp .cjs.package.json ./dist/server/cjs/packages/fxa-auth-client/package.json", "compile": "tsc --noEmit", "ts-check": "tsc --noEmit", "test": "mocha -r esbuild-register test/*",