|
- import { copyFileSync, readFileSync, writeFileSync } from 'fs';
- import { resolve } from 'path';
-
- const doCopy = (src: string, dest: string) => {
- const trueSrc = resolve(src);
- const trueDest = resolve(dest);
- console.log('Copying...');
- console.log(`${trueSrc} -> ${trueDest}`);
- copyFileSync(trueSrc, trueDest);
- const packageJsonContents = readFileSync('./package.json', 'utf-8');
- const packageJson = JSON.parse(packageJsonContents);
- packageJson.exports[dest] = dest;
- const newPackageJsonContents = JSON.stringify(packageJson, null, 2);
- console.log('Updating package.json...');
- writeFileSync('./package.json', newPackageJsonContents);
- console.log('Done');
- }
-
- doCopy('./src/components/DropdownSelect/DropdownSelect.css', './dist/DropdownSelect.css');
- doCopy('./src/components/MenuSelect/MenuSelect.css', './dist/MenuSelect.css');
- doCopy('./src/components/RadioButton/RadioButton.css', './dist/RadioButton.css');
- doCopy('./src/components/RadioTickBox/RadioTickBox.css', './dist/RadioTickBox.css');
|