You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/preprocess/samples/use-scss-preprocessor-with-.../_config.js

27 lines
505 B

import * as sass from 'node-sass';
import * as path from 'path';
export default {
cascade: false,
style: ({ content, attributes }) => {
if (attributes.type !== 'text/scss') {
return {code: content};
}
return new Promise((fulfil, reject) => {
sass.render({
data: content,
includePaths: [
path.resolve(__dirname)
]
}, (err, result) => {
if (err) {
reject(err);
} else {
fulfil({ code: result.css.toString(), map: result.map });
}
});
});
}
};