-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
27 lines (24 loc) · 894 Bytes
/
svelte.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const sass = require('node-sass');
module.exports = {
preprocess: {
style: async ({ content, attributes }) => {
if (attributes.type !== 'text/scss' && attributes.lang !== 'scss') return; // lang is now taken into account
return new Promise((resolve, reject) => {
sass.render(
{
data: content,
sourceMap: false,
outFile: 'x', // this is necessary, but is ignored
},
(err, result) => {
if (err) return reject(err);
resolve({
code: result.css.toString(),
map: result.map ? result.map.toString() : ""
});
},
);
});
},
},
};