From 8f862a901f2d086a5c3a9d4f3740ff72ec9f69b6 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Wed, 8 Nov 2023 15:31:12 +0100 Subject: [PATCH] fix(deno): Emit .mjs files (#9485) --- packages/deno/package.json | 3 +-- packages/deno/rollup.config.js | 2 +- packages/deno/test/example.ts | 2 +- packages/deno/test/mod.test.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/deno/package.json b/packages/deno/package.json index 0628ba62a73e..9390486edb15 100644 --- a/packages/deno/package.json +++ b/packages/deno/package.json @@ -6,7 +6,6 @@ "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/deno", "author": "Sentry", "license": "MIT", - "main": "build/index.js", "module": "build/index.js", "types": "build/index.d.ts", "publishConfig": { @@ -51,7 +50,7 @@ "pretest": "run-s deno-types test:build", "test": "run-s install:deno test:types test:unit", "test:build": "tsc -p tsconfig.test.types.json && rollup -c rollup.test.config.js", - "test:types": "deno check ./build/index.js", + "test:types": "deno check ./build/index.mjs", "test:unit": "deno test --allow-read --allow-run", "test:unit:update": "deno test --allow-read --allow-write --allow-run -- --update", "yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push" diff --git a/packages/deno/rollup.config.js b/packages/deno/rollup.config.js index d79b77478053..bf76973b9801 100644 --- a/packages/deno/rollup.config.js +++ b/packages/deno/rollup.config.js @@ -7,7 +7,7 @@ export default defineConfig({ input: ['src/index.ts'], treeshake: 'smallest', output: { - dir: 'build', + file: 'build/index.mjs', sourcemap: true, preserveModules: false, strict: false, diff --git a/packages/deno/test/example.ts b/packages/deno/test/example.ts index 6f93bd288afd..0ac351f1fc50 100644 --- a/packages/deno/test/example.ts +++ b/packages/deno/test/example.ts @@ -1,4 +1,4 @@ -import * as Sentry from '../build/index.js'; +import * as Sentry from '../build/index.mjs'; Sentry.init({ dsn: 'https://1234@some-domain.com/4505526893805568', diff --git a/packages/deno/test/mod.test.ts b/packages/deno/test/mod.test.ts index f457033efe96..cf093af034fe 100644 --- a/packages/deno/test/mod.test.ts +++ b/packages/deno/test/mod.test.ts @@ -3,7 +3,7 @@ import { assertSnapshot } from 'https://deno.land/std@0.202.0/testing/snapshot.t import type { sentryTypes } from '../build-test/index.js'; import { sentryUtils } from '../build-test/index.js'; -import { defaultIntegrations, DenoClient, Hub, Scope } from '../build/index.js'; +import { defaultIntegrations, DenoClient, Hub, Scope } from '../build/index.mjs'; import { getNormalizedEvent } from './normalize.ts'; import { makeTestTransport } from './transport.ts';