Skip to content

Commit 13f7dc8

Browse files
Lms24andreialecu
andcommitted
fix(angular-ivy): Add exports field to package.json (#10569)
Add an `exports` field to the `package.json` for `@sentry/angular-ivy`. While it seems like regular Angular apps didn't need it, tools like `vitest` expect the field as soon as `type: "module"` is specified. --- Co-authored-by: Andrei Alecu <[email protected]>
1 parent cbd6721 commit 13f7dc8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/angular-ivy/scripts/prepack.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type PackageJson = {
66
type?: string;
77
nx?: string;
88
volta?: any;
9+
exports?: Record<string, string | Record<string, string>>;
910
};
1011

1112
const buildDir = path.join(process.cwd(), 'build');
@@ -18,6 +19,18 @@ const pkgJson: PackageJson = JSON.parse(fs.readFileSync(pkjJsonPath).toString())
1819
delete pkgJson.main;
1920
pkgJson.type = 'module';
2021

22+
pkgJson.exports = {
23+
'.': {
24+
es2015: './fesm2015/sentry-angular-ivy.js',
25+
esm2015: './esm2015/sentry-angular-ivy.js',
26+
fesm2015: './fesm2015/sentry-angular-ivy.js',
27+
import: './fesm2015/sentry-angular-ivy.js',
28+
require: './bundles/sentry-angular-ivy.umd.js',
29+
types: './sentry-angular-ivy.d.ts',
30+
},
31+
'./*': './*',
32+
};
33+
2134
// no need to keep around other properties that are only relevant for our reop:
2235
delete pkgJson.nx;
2336
delete pkgJson.volta;

0 commit comments

Comments
 (0)