I'm facing an issue where I need to assign an alias for 'Hammer' in my code. I've already included the necessary paths in my tsconfig file as shown below:
{
"compilerOptions": {
"declaration": true,
"noImplicitAny": false ,
"noEmitOnError": true,
"noUnusedLocals": false ,
"noUnusedParameters": false ,
"module": "commonjs",
"moduleResolution": "node",
"target": "ES5",
"outDir": "./lib",
"lib": ["ES5", "ES2015.Promise", "DOM", "ES2015.Collection", "es2016"],
"jsx": "react",
"types": [],
"baseUrl": ".",
"paths": {
"Hammer": ["hammerjs/hammer.js"]
}
},
"include": ["typings/index.d.ts","src/*"]
}
Despite having set up the alias, I'm still encountering an error when trying to use 'Hammer' in geo.js with 'require(Hammer)'. Can someone point out what I might be missing?
ERROR in ./~/geojs/geo.js
Module not found: Error: Can't resolve 'Hammer' in '/home/chaudhary/tools/jupyterlab/mydev/share/jupyter/lab/staging/node_modules/geojs'
@ ./~/geojs/geo.js 3:27-44
@ ./~/@jupyterlab/geojson-extension/lib/index.js
@ ./build/index.out.js