diff --git a/spec/indexeddb_spec.mjs b/spec/indexeddb_spec.js similarity index 92% rename from spec/indexeddb_spec.mjs rename to spec/indexeddb_spec.js index 4596c15..7c55c2f 100644 --- a/spec/indexeddb_spec.mjs +++ b/spec/indexeddb_spec.js @@ -1,4 +1,4 @@ -import { SlopDB } from "../scripts/indexed-db.mjs" +import { SlopDB } from "../scripts/indexed-db.js" describe("sanity check", () => { it("works", () => { diff --git a/spec/support/jasmine-browser.mjs b/spec/support/jasmine-browser.mjs index 27ff92f..6b2c9d7 100644 --- a/spec/support/jasmine-browser.mjs +++ b/spec/support/jasmine-browser.mjs @@ -10,7 +10,7 @@ export default { helpers: [ "spec/helpers/**/*.?(m)js" ], - esmFilenameExtension: ".mjs", + esmFilenameExtension: ".js", // Set to true if you need to load module src files instead of loading via the spec files. modulesWithSideEffectsInSrcFiles: false, // Allows the use of top-level await in src/spec/helper files. This is off by @@ -34,5 +34,11 @@ export default { browser: { name: "firefox", headless: true + }, + "importMap": { + "moduleRootDir": "scripts", + "imports": { + "idb/": "scripts/idb/" + } } }; diff --git a/src/indexed-db.mts b/src/indexed-db.ts similarity index 98% rename from src/indexed-db.mts rename to src/indexed-db.ts index 9f45d1e..bd04837 100644 --- a/src/indexed-db.mts +++ b/src/indexed-db.ts @@ -1,4 +1,4 @@ -import { openDB, IDBPDatabase } from "/idb/index.js" +import { openDB, IDBPDatabase } from "idb/index.js" export class IDBCursorValueIterator { cursor: IDBCursorWithValue diff --git a/tsconfig.json b/tsconfig.json index a30b215..077e132 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,7 @@ "target": "esnext", "baseUrl": ".", "paths": { - "/idb/*": ["node_modules/idb/build/*"] + "idb/*": ["node_modules/idb/build/*"] }, "module": "nodenext",