Require with relative paths not working as expected

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.

Hey, relative paths work fine with our require in tests, so this is either a quirk in our implementation or something else. First of all, as a sanity check, is context.js a :Bundled file in your unoproj?