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

25 lines
531 B

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