I’m trying to import a module using a relative path with … in it and are getting module not found errors.
Here’s the source code (compiled by tsc).
var context_1 = require('../../data/context');
exports.context = context_1.context;
function showItem(event) {
router.push("detail");
}
exports.showItem = showItem;
//# sourceMappingURL=Directory.js.map
I.e. the original source code looks like this:
export { context } from '../../data/context'
declare var router: any;
export function showItem(event) {
router.push("detail");
}
which Typescript is ok with since it correctly resolves ‘…/…/data/context’ and compiles.
I tried using an absolute path instead ‘/src/data/context’ which typescript can’t resolve
and a relative path ‘src/data/context’ which typescript can resolve using the ‘classic’ module resolution strategy, but fails to load with require.
Any solution to this?
IMHO, relative files with … should be handled by Fuse’s require implementation.