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/_config.js

27 lines
527 B

import * as sass from 'node-sass';
export default {
cascade: false,
style: ({ content, attributes }) => {
if (attributes.type !== 'text/scss') {
return {code: content};
}
if (attributes['aria-hidden'] !== true) {
throw new Error('aria-hidden is supposed to be true');
}
return new Promise((fulfil, reject) => {
sass.render({
data: content,
}, (err, result) => {
if (err) {
reject(err);
} else {
fulfil({ code: result.css.toString(), map: result.map });
}
});
});
}
};