@cara/porter
Advanced tools
Comparing version 4.2.11 to 4.2.12
{ | ||
"name": "@cara/porter", | ||
"description": "A middleware for web modules", | ||
"version": "4.2.11", | ||
"version": "4.2.12", | ||
"main": "src/porter.js", | ||
@@ -45,3 +45,4 @@ "repository": { | ||
}, | ||
"license": "BSD-3-Clause" | ||
"license": "BSD-3-Clause", | ||
"gitHead": "9500b6657a83a63cf200c44f46c2025a6264e3ee" | ||
} |
@@ -5,2 +5,3 @@ 'use strict'; | ||
const sass = require('sass'); | ||
const { pathToFileURL } = require('url'); | ||
const CssModule = require('./css_module'); | ||
@@ -15,7 +16,14 @@ | ||
async transpile({ code, map, minify }) { | ||
const { packet } = this; | ||
const { fpath, packet } = this; | ||
const loadPaths = packet.paths || [ packet.dir ]; | ||
const result = sass.compileString(code, { | ||
const result = await sass.compileStringAsync(code, { | ||
loadPaths, | ||
url: pathToFileURL(fpath), | ||
importers: [{ | ||
findFileUrl: async (url) => { | ||
const mod = await this.parseImport(url); | ||
return mod ? pathToFileURL(mod.fpath) : null; | ||
}, | ||
}], | ||
}); | ||
@@ -22,0 +30,0 @@ |
128415
3469