本文整理汇总了TypeScript中sorcery.load函数的典型用法代码示例。如果您正苦于以下问题:TypeScript load函数的具体用法?TypeScript load怎么用?TypeScript load使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: debug
export const remapSourcemap = (sourceFile: string, base?: string): Promise<any> => {
debug(`re-mapping sources for ${sourceFile}`);
const opts: any = {
inline: false,
includeContent: true,
};
if (base) {
opts.base = base;
}
// Once sorcery loaded the chain of sourcemaps, the new sourcemap will be written asynchronously.
return sorcery.load(sourceFile)
.then((chain) => chain.write(opts));
}
示例2: mapSources
export async function mapSources(file: string) {
const chain = await sorcery.load(file);
chain.write();
}
示例3:
}).then( () => sorcery.load(Path.join(copyInst.toBundle, `${meta.umd}.rollup.umd.js`)).then( chain => chain.write() ));
示例4: remapSourcemap
/**
* Finds the original sourcemap of the file and maps it to the current file.
* This is useful when multiple transformation happen (e.g TSC -> Rollup -> Uglify)
**/
async function remapSourcemap(sourceFile: string) {
// Once sorcery loaded the chain of sourcemaps, the new sourcemap will be written asynchronously.
return (await sorcery.load(sourceFile)).write();
}