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.

43 line
1.1 KiB

  1. //@ts-check
  2. /** @type { import('fantasticon').RunnerOptions} } */
  3. const config = {
  4. name: 'glicons',
  5. prefix: 'glicons',
  6. codepoints: require('./images/icons/template/mapping.json'),
  7. inputDir: './images/icons',
  8. outputDir: './dist',
  9. // @ts-ignore
  10. fontTypes: ['woff2'],
  11. normalize: true,
  12. // @ts-ignore
  13. assetTypes: ['html', 'scss', 'json'],
  14. templates: {
  15. html: './images/icons/template/icons-contribution.hbs',
  16. scss: './images/icons/template/styles.hbs',
  17. },
  18. formatOptions: {
  19. json: {
  20. indent: 2,
  21. },
  22. },
  23. pathOptions: {
  24. woff2: './dist/glicons.woff2',
  25. scss: './src/webviews//apps/shared/glicons.scss',
  26. html: './icons-contribution.json',
  27. json: './images/icons/template/mapping.json',
  28. },
  29. onComplete: _fontConfig => {
  30. const fs = require('fs');
  31. // Update the icons contribution point in package.json
  32. const package = require('./package.json');
  33. package.contributes.icons = require('./icons-contribution.json').icons;
  34. const packageJSON = `${JSON.stringify(package, undefined, '\t')}\n`;
  35. fs.writeFileSync('./package.json', packageJSON);
  36. fs.rmSync('./icons-contribution.json');
  37. },
  38. };
  39. module.exports = config;