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

21 lines
370 B

import * as stylus from 'stylus';
export default {
cascade: false,
style: ({content, attributes}) => {
if (attributes.type !== 'text/stylus') {
return {code: content};
}
return new Promise((fulfil, reject) => {
stylus(content).render((err, result) => {
if (err) {
reject(err);
} else {
fulfil({code: result});
}
});
});
},
};