forked from parcel-bundler/lightningcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
33 lines (28 loc) · 675 Bytes
/
test.js
File metadata and controls
33 lines (28 loc) · 675 Bytes
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
const css = require('./native');
if (process.argv[process.argv.length - 1] !== __filename) {
let opts = {
filename: process.argv[process.argv.length - 1],
code: require('fs').readFileSync(process.argv[process.argv.length - 1]),
targets: {
chrome: 95 << 16
}
};
console.time('optimize');
let r = css.transform(opts);
console.timeEnd('optimize')
console.log(r.toString());
return;
}
let res = css.transform({
filename: __filename,
targets: {
safari: 5 << 16,
firefox: 14 << 16,
opera: 10 << 16 | 5 << 8
},
code: Buffer.from(`
.foo + .bar:not(.baz) {
transition: opacity 200ms;
}
`)});
console.log(res.toString());