-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
2 hours ago in this link was the new version of docs, now is older. I'm not sure if it's relevant now.
There is SASS example that contains a few typos. +async -)
const svelte = require('svelte/compiler');
const sass = require('node-sass');
const { dirname } = require('path');
const { code, dependencies } = svelte.preprocess(source, {
style: async ({ content, attributes, filename }) => {
// only process <style lang="sass">
if (attributes.lang !== 'sass') return;
const { css, stats } = await new Promise((resolve, reject) => sass.render({
file: filename,
data: content,
includePaths: [
dirname(filename),
],
}, (err, result) => {
if (err) reject(err);
else resolve(result);
}));
return {
code: css.toString(),
dependencies: stats.includedFiles
};
}
}, {
filename: 'App.svelte'
});Metadata
Metadata
Assignees
Labels
No labels