// List of all aliases for canisters. This creates the module alias for
// the `import ... from "ic:canisters/xyz"` where xyz is the name of a
// canister.
const aliases = Object.entries(dfxJson.canisters)
.filter(([name,value]) => value.main)
.reduce((acc, [name,value]) => {
const outputRoot = path.join(__dirname, dfxJson.defaults.build.output, name);
const filename = path.basename(value.main, ".mo");
return {
...acc,
["ic:canisters/" + name]: path.join(outputRoot, filename + ".js"),
["ic:idl/" + name]: path.join(outputRoot, filename + ".did.js"),
};
}, {});