Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 24 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import postcss from "postcss" |
||
2 | //@ts-expect-error |
||
3 | import postcssDTs = require("postcss-d-ts") |
||
4 | import {readFileSync} from "fs" |
||
5 | |||
6 | const producer = postcss([postcssDTs()]) |
||
7 | |||
8 | produce([ |
||
9 | "bootstrap3/dist/css/bootstrap.css", |
||
10 | "bootstrap4/dist/css/bootstrap.css", |
||
11 | "material10/dist/material-components-web.css" |
||
12 | ]) |
||
13 | |||
14 | async function produce(sources: string[]) { |
||
15 | for (let i = sources.length; i--;) { |
||
16 | const p = sources[i] |
||
17 | , name = p.replace(/\/.*$/, "") |
||
18 | , path = require.resolve(p) |
||
19 | |||
20 | await producer.process(readFileSync(path).toString(), { |
||
21 | from: `${__dirname}/${name}.css` |
||
22 | }) |
||
23 | } |
||
24 | } |