x/packup@v0.1.13/sass_util.ts

📦 Zero-config web application packager in Deno
GitHub Stars
272
Latest
/** Compiles the given string into css. * * TODO(kt3k): Support importer */export async function compile(text: string): Promise<string> { // Use dynamic import because sass.js is slow to import const start = performance.now(); console.log("Importing sass"); const { Sass } = await import("./vendor/" + "sass/mod.ts"); console.log(`Imported sass in ${(performance.now() - start).toFixed(1)}ms`); return new Promise((resolve, reject) => { // deno-lint-ignore no-explicit-any Sass.compile(text, (result: any) => { if (result.status === 0) { resolve(result.text); } else { reject(new Error(result.message)); } }); });}