Design system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
1017 B

  1. import { copyFileSync, readFileSync, writeFileSync } from 'fs';
  2. import { resolve } from 'path';
  3. const doCopy = (src: string, dest: string) => {
  4. const trueSrc = resolve(src);
  5. const trueDest = resolve(dest);
  6. console.log('Copying...');
  7. console.log(`${trueSrc} -> ${trueDest}`);
  8. copyFileSync(trueSrc, trueDest);
  9. const packageJsonContents = readFileSync('./package.json', 'utf-8');
  10. const packageJson = JSON.parse(packageJsonContents);
  11. packageJson.exports[dest] = dest;
  12. const newPackageJsonContents = JSON.stringify(packageJson, null, 2);
  13. console.log('Updating package.json...');
  14. writeFileSync('./package.json', newPackageJsonContents);
  15. console.log('Done');
  16. }
  17. doCopy('./src/components/DropdownSelect/DropdownSelect.css', './dist/DropdownSelect.css');
  18. doCopy('./src/components/MenuSelect/MenuSelect.css', './dist/MenuSelect.css');
  19. doCopy('./src/components/RadioButton/RadioButton.css', './dist/RadioButton.css');
  20. doCopy('./src/components/RadioTickBox/RadioTickBox.css', './dist/RadioTickBox.css');