My current project in Typescript involves using requirejs to load jQuery successfully. However, I'm encountering difficulties setting up Dexie.
Here is how my require config is set up:
require.config({
baseUrl: '',
paths: {
//main libraries
jquery: 'scripts/jquery-2.2.1',
dexie: 'node_modules/dexie/dist/dexie.min'
},
shim: {
jquery: {
exports: '$'
}
}
});
When I include this in a require() function like the following, it works perfectly fine:
require(['jquery', 'dexie'], function ($) {
$(document).ready(() => {
alert('all good');
});
});
However, when attempting to import Dexie using Typescript with:
import dexie = require('dexie');
I receive an error stating that 'dexie' cannot be found.
The official documentation suggests using:
import Dexie from 'dexie';
But even that solution isn't working for me. Any ideas on what I might be doing incorrectly?