-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathrollup-css.config.js
More file actions
41 lines (39 loc) · 1.14 KB
/
rollup-css.config.js
File metadata and controls
41 lines (39 loc) · 1.14 KB
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
39
40
41
import postcss from 'rollup-plugin-postcss';
import path from 'path';
import { fileURLToPath } from 'url';
// Get the directory name of the current module
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default {
input: 'styles/themes/default.scss',
output: {
file: 'dist/themes/default.css'
},
onwarn(warning, warn) {
// Suppress CSS file overwrite warnings
if (warning.code === 'FILE_NAME_CONFLICT') {
return;
}
warn(warning);
},
plugins: [
postcss({
extract: true,
minimize: true,
use: {
sass: {
includePaths: [__dirname],
importer: [
function(url) {
if (url.startsWith('~')) {
return {
file: path.resolve(__dirname, url.substring(1))
};
}
return null;
}
]
}
}
})
]
};