Skip to content

Commit 495e594

Browse files
committed
switch esm and commonjs
1 parent 344a0c2 commit 495e594

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

platform-includes/getting-started-config/javascript.nestjs.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
```javascript {tabTitle:CommonJS} {filename: instrument.js} {"onboardingOptions": {"performance": "11-14", "profiling": "2, 7-10, 15-18"}}
2-
const Sentry = require("@sentry/nestjs");
3-
const { nodeProfilingIntegration } = require("@sentry/profiling-node");
1+
```javascript {tabTitle:ESM} {filename: instrument.mjs} {"onboardingOptions": {"performance": "11-14", "profiling": "2, 7-10, 15-18"}}
2+
import * as Sentry from "@sentry/nestjs";
3+
import { nodeProfilingIntegration } from '@sentry/profiling-node';
44

5-
// Ensure to call this before requiring any other modules!
5+
// Ensure to call this before importing any other modules!
66
Sentry.init({
77
dsn: "___PUBLIC_DSN___",
88
integrations: [
@@ -20,11 +20,11 @@ Sentry.init({
2020
});
2121
```
2222

23-
```javascript {tabTitle:ESM} {filename: instrument.mjs} {"onboardingOptions": {"performance": "11-14", "profiling": "2, 7-10, 15-18"}}
24-
import * as Sentry from "@sentry/nestjs";
25-
import { nodeProfilingIntegration } from '@sentry/profiling-node';
23+
```javascript {tabTitle:CommonJS} {filename: instrument.js} {"onboardingOptions": {"performance": "11-14", "profiling": "2, 7-10, 15-18"}}
24+
const Sentry = require("@sentry/nestjs");
25+
const { nodeProfilingIntegration } = require("@sentry/profiling-node");
2626

27-
// Ensure to call this before importing any other modules!
27+
// Ensure to call this before requiring any other modules!
2828
Sentry.init({
2929
dsn: "___PUBLIC_DSN___",
3030
integrations: [
@@ -41,3 +41,4 @@ Sentry.init({
4141
profilesSampleRate: 1.0,
4242
});
4343
```
44+

0 commit comments

Comments
 (0)