本文整理匯總了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();
}