Skip to content

Commit

Permalink
Fix issues with declarations and eval worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Sep 9, 2024
1 parent 5e3acf1 commit f51eccd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/examples/packages/images/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"baseUrl": "./",
"paths": {
"@metamask/*": ["../../../*/src"]
}
},
"module": "ES2020",
"moduleResolution": "Node10"
},
"include": ["src", "snap.config.ts"],
"references": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// eslint-disable-next-line import/unambiguous
declare module '*.svg' {
const content: string;
export default content;
}

declare module '*.png' {
const content: string;
export default content;
}

declare module '*.svg' {
declare module '*.jpg' {
const content: string;
export default content;
}
1 change: 1 addition & 0 deletions packages/snaps-sdk/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This is intentionally imported, rather than re-exported.
/* eslint-disable import/no-unassigned-import */
import './global';
import './images';
/* eslint-enable import/no-unassigned-import */

export * from './caip';
Expand Down
4 changes: 3 additions & 1 deletion packages/snaps-sdk/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist",
"rootDir": "./src"
"rootDir": "./src",
"module": "ES2020",
"moduleResolution": "Node10"
},
"include": ["./src"],
"exclude": [
Expand Down
4 changes: 3 additions & 1 deletion packages/snaps-sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"compilerOptions": {
"baseUrl": "./",
"jsx": "react-jsx",
"jsxImportSource": "@metamask/snaps-sdk"
"jsxImportSource": "@metamask/snaps-sdk",
"module": "ES2020",
"moduleResolution": "Node10"
},
"include": [
"./src",
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-utils/src/eval-worker.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require('ts-node').register({
transpileOnly: true,
compilerOptions: {
module: 'commonjs',
module: 'Node16',
}
});

Expand Down

0 comments on commit f51eccd

Please sign in to comment.