-
Notifications
You must be signed in to change notification settings - Fork 60
/
postcss.config.js
49 lines (46 loc) · 1.75 KB
/
postcss.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
39
40
41
42
43
44
45
46
47
48
49
'use strict'
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const postcssClean = require('postcss-clean');
const postcssBanner = require('postcss-banner');
const postcssAddFallback = require('./postcss-add-fallback.js');
const postcssCustomProperties = require('postcss-custom-properties'); //ie11 fallbacks
const postcssImport = require('postcss-import');
const postcssRemoveFonts = require('./postcss-remove-fonts.js');
const packageVersion = require('../package.json').version;
const year = new Date().getFullYear();
const minify = process.env.NODE_ENV === 'production' ? cssnano({
preset: [
'default', {
mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
mergeRules: false, // https://github.com/cssnano/cssnano/issues/730
},
]
}) : null;
module.exports = {
inline: false,
annotation: true,
sourcesContent: true,
plugins: [
postcssImport(),
postcssAddFallback({importFrom: 'dist/root.css'}),
postcssAddFallback({importFrom: 'node_modules/@sap-theming/theming-base-content/content/Base/baseLib/sap_fiori_3/css_variables.css'}),
autoprefixer({
cascade: true
}),
postcssClean({
format: 'beautify',
level: 1
}),
postcssCustomProperties({
preserve: true
}),
postcssRemoveFonts(), // remove fonts from @sap-theming/theming-base-content
minify,
postcssBanner({
banner: `Fundamental Library Styles v${packageVersion}
Copyright (c) ${year} SAP SE or an SAP affiliate company.
Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/master/LICENSE)`,
important: true})
]
}