mirror of
https://github.com/lscambo13/ElegantFin.git
synced 2026-10-26 09:39:34 +00:00
dev: use cssnano, postcss, postcss-cli and css-declaration-sorter packages for more control over minification
dev: exclude some files dev: sort declarations alphabetically during minification
This commit is contained in:
1 parent
9972862b5e
commit
ba0aabd07b
4 files changed
+1764
-1
No files matched your search
@@ -0,0 +1,22 @@
|
||||
const cssDeclarationSorter = require('css-declaration-sorter');
|
||||
const cssnano = require('cssnano');
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
cssDeclarationSorter({
|
||||
keepOverrides: true,
|
||||
order: (a, b) => {
|
||||
const aVar = a.startsWith('--');
|
||||
const bVar = b.startsWith('--');
|
||||
|
||||
if (aVar && !bVar) return -1;
|
||||
if (!aVar && bVar) return 1;
|
||||
|
||||
return a.localeCompare(b);
|
||||
},
|
||||
}),
|
||||
cssnano({
|
||||
preset: 'default',
|
||||
}),
|
||||
],
|
||||
};
|
||||
Reference in new issue
Block a user