I'm currently working on developing a game using EaselJS, and in this day and age, I've opted to use TypeScript. I have incorporated the "official" types from this source. However, I am encountering difficulties when trying to integrate it with parceljs. When I import the types, parcel fails to build. On the other hand, if I exclude the types during import, parcel works seamlessly but I lose type support in VS Code.
Below is the import that successfully builds with parcel:
import * as createjs from '@createjs/easeljs';
In VS Code, an info warning pops up stating
Could not find a declaration file for module '@createjs/easeljs'
, consequently causing issues with the types.
On the other hand, here's an import that pleases VS Code but disappoints parcel:
import 'createjs';
While this enables the EaselJS types to function properly in VS Code, the parcel build fails with the error
src/main.ts:3:8: Cannot resolve dependency 'createjs'
. Quite frustrating!
Here is a snippet of my package.json:
{
"name": "corona-coaster",
"version": "0.1.0",
"license": "GPL-3.0-only",
...
}
And my tsconfig:
{
"compilerOptions": {
"baseUrl": "./src",
"paths": {
"~/*": [
"./*"
]
},
...
}
}
You can find the GitHub repository here. Please note that switching to webpack is not an option for me at this time.