parcel_css 1.0.0-alpha.25

A CSS parser, transformer, and minifier
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
const fs = require('fs');

let dir = `${__dirname}/../`;
let index = fs.readFileSync(dir + '/node/index.d.ts', 'utf8');
index = '// @flow\n' + index;
index = index.replace(/export interface (.*?) \{((?:.|\n)*?)\}/g, 'export type $1 = {|$2|};');
index = index.replace(/export declare function/g, 'declare export function');

let targets = fs.readFileSync(dir + '/node/targets.d.ts', 'utf8');
targets = targets.replace(/export interface (.*?) \{((?:.|\n)*?)\}/g, 'export type $1 = {|$2|};');
index = index.replace("import type {Targets} from './targets';", targets);

fs.writeFileSync(dir + '/node/index.js.flow', index);