/
autoprefixer.js
40 lines (34 loc) · 977 Bytes
/
autoprefixer.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
'use strict';
const { test } = require('node:test');
const {
processCSSWithPresetFactory,
} = require('../../../util/integrationTestHelpers.js');
const preset = require('..');
const { processCSS } = processCSSWithPresetFactory(preset);
test(
'should remove outdated vendor prefixes',
processCSS(
'h1{-webkit-box-sizing:content-box;box-sizing:content-box}',
'h1{box-sizing:content-box}'
)
);
const { passthroughCSS } = processCSSWithPresetFactory(
preset({
autoprefixer: {
overrideBrowserslist: 'Safari < 5',
},
})
);
test(
'should not remove outdated vendor prefixes when minifying for older browsers',
passthroughCSS('h1{-webkit-border-radius:5px;border-radius:5px}')
);
const { passthroughCSS: exclude } = processCSSWithPresetFactory(
preset({
autoprefixer: { exclude: true },
})
);
test(
'should not remove outdated vendor prefixes if excluded',
exclude('h1{-webkit-box-sizing:content-box;box-sizing:content-box}')
);