##// END OF EJS Templates
added 'dom-inject' and 'css' modules
added 'dom-inject' and 'css' modules

File last commit:

r6:5cc84d1fc7c0 default
r6:5cc84d1fc7c0 default
Show More
css.ts
17 lines | 529 B | video/mp2t | TypeScriptLexer
cin
added 'dom-inject' and 'css' modules
r6 import inject = require("./inject");
import { id as mid} from "module";
import { TraceSource } from "@implab/core-amd/log/TraceSource";
const log = TraceSource.get(mid);
const plugin = {
load: async (id: string, require: Require, cb: (param: any) => void) => {
const url = require.toUrl(id);
try {
await inject.injectStylesheet(url);
cb({ url });
} catch (e) {
log.error("CSS plugin failed to load {0} ({1}): {2}", id, url, e);
}
}
};
export = plugin;