diff --git a/constraints.pro b/constraints.pro index 72e5a177..8474011e 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']). +gen_enforced_field(WorkspaceCwd, 'files', ['dist', 'stream-provider.js']). % If a dependency is listed under "dependencies", it should not be listed under % "devDependencies". diff --git a/package.json b/package.json index aff541fa..2695fd7f 100644 --- a/package.json +++ b/package.json @@ -39,13 +39,24 @@ "default": "./dist/StreamProvider.cjs" } }, + "./stream-provider": { + "import": { + "types": "./dist/StreamProvider.d.mts", + "default": "./dist/StreamProvider.mjs" + }, + "require": { + "types": "./dist/StreamProvider.d.cts", + "default": "./dist/StreamProvider.cjs" + } + }, "./package.json": "./package.json" }, "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.cts", "files": [ - "dist" + "dist", + "stream-provider.js" ], "scripts": { "build": "ts-bridge --project tsconfig.build.json --clean", diff --git a/stream-provider.js b/stream-provider.js new file mode 100644 index 00000000..49a8a799 --- /dev/null +++ b/stream-provider.js @@ -0,0 +1,3 @@ +// Re-exported for compatibility with Browserify. +// eslint-disable-next-line +module.exports = require('./dist/StreamProvider.cjs');