Skip to content

Commit

Permalink
ref: Use esm imports with localforage and add esModuleInterop (#3403)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek authored Apr 16, 2021
1 parent 2bb98c1 commit f48efb8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions packages/integrations/src/offline.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { Event, EventProcessor, Hub, Integration } from '@sentry/types';
import { getGlobalObject, logger, normalize, uuid4 } from '@sentry/utils';
import * as localForageType from 'localforage';
import localForage from 'localforage';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const localForage = require('localforage');
/**
* cache offline errors and send when connected
*/
Expand Down Expand Up @@ -38,7 +36,7 @@ export class Offline implements Integration {
/**
* event cache
*/
public offlineEventStore: typeof localForageType; // type imported from localforage
public offlineEventStore: typeof localForage;

/**
* @inheritDoc
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"declarationMap": false,
"esModuleInterop": true,
"baseUrl": ".",
"outDir": "dist",
"types": ["node"]
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.esm.json",
"compilerOptions": {
"declarationMap": false,
"esModuleInterop": true,
"baseUrl": ".",
"outDir": "esm",
"types": ["node"]
Expand Down
1 change: 0 additions & 1 deletion packages/integrations/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"include": ["src/**/*.ts", "test/**/*.ts"],
"exclude": ["dist"],
"compilerOptions": {
"esModuleInterop": true,
"declarationMap": false,
"rootDir": ".",
"types": ["node", "jest"]
Expand Down

0 comments on commit f48efb8

Please sign in to comment.