-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
38 lines (35 loc) · 1.1 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
// This file is used by the editor (e.g. vscode) to configure svelte settings
// We have to use 'require' here because this config isn't processed by babel
const sveltePreprocess = require("svelte-preprocess");
const path = require("path");
// We use a function to set up sveltePreprocess to avoid duplication (so it can
// be exported and re-used for the actual rollup.config.js svelte preprocess directive)
function createPreprocessors(sourceMap) {
return sveltePreprocess({
sourceMap,
defaults: {
style: "scss",
},
scss: {
// We can use a path relative to the root because
// svelte-preprocess automatically adds it to `includePaths`
// if none is defined.
prependData: `@import 'src/styles/variables.scss';`,
},
postcss: {
plugins: [
require("autoprefixer")(),
require("postcss-file")({
url: "copy",
assetsPath: "public/build/assets",
publicPath: "/build/assets/",
hash: true,
}),
],
},
});
}
module.exports = {
preprocess: createPreprocessors(true),
createPreprocessors,
};