diff --git a/constraints.pro b/constraints.pro index 8474011e..9b7b06c1 100644 --- a/constraints.pro +++ b/constraints.pro @@ -82,7 +82,7 @@ gen_enforced_field(WorkspaceCwd, 'exports["./package.json"]', './package.json'). % The list of files included in the package must only include files generated % during the build step. -gen_enforced_field(WorkspaceCwd, 'files', ['dist', 'stream-provider.js']). +gen_enforced_field(WorkspaceCwd, 'files', ['dist', 'initializeInpageProvider.d.ts', 'initializeInpageProvider.js', 'stream-provider.js']). % If a dependency is listed under "dependencies", it should not be listed under % "devDependencies". diff --git a/initializeInpageProvider.d.ts b/initializeInpageProvider.d.ts new file mode 100644 index 00000000..3cf80c10 --- /dev/null +++ b/initializeInpageProvider.d.ts @@ -0,0 +1,5 @@ +/* eslint-disable import/extensions */ + +// Re-exported for compatibility with build tools that don't support the +// `exports` field in package.json +export * from './dist/initializeInpageProvider.cjs'; diff --git a/initializeInpageProvider.js b/initializeInpageProvider.js new file mode 100644 index 00000000..76b53ff4 --- /dev/null +++ b/initializeInpageProvider.js @@ -0,0 +1,5 @@ +/* eslint-disable import/extensions,import/no-unresolved */ + +// Re-exported for compatibility with build tools that don't support the +// `exports` field in package.json +module.exports = require('./dist/initializeInpageProvider.cjs'); diff --git a/package.json b/package.json index 3de8ccfc..0d24043b 100644 --- a/package.json +++ b/package.json @@ -49,9 +49,15 @@ "default": "./dist/initializeInpageProvider.cjs" } }, - "./dist/initializeInpageProvider.cjs": { - "types": "./dist/initializeInpageProvider.d.cts", - "default": "./dist/initializeInpageProvider.cjs" + "./initializeInpageProvider": { + "import": { + "types": "./dist/initializeInpageProvider.d.mts", + "default": "./dist/initializeInpageProvider.mjs" + }, + "require": { + "types": "./dist/initializeInpageProvider.d.cts", + "default": "./dist/initializeInpageProvider.cjs" + } }, "./stream-provider": { "import": { @@ -70,6 +76,8 @@ "types": "./dist/index.d.cts", "files": [ "dist", + "initializeInpageProvider.d.ts", + "initializeInpageProvider.js", "stream-provider.js" ], "scripts": {