Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

33 rader
834 B

  1. const Path = require('path');
  2. const Chalk = require('chalk');
  3. const FileSystem = require('fs');
  4. const Vite = require('vite');
  5. const compileTs = require('./private/tsc');
  6. function buildRenderer() {
  7. return Vite.build({
  8. configFile: Path.join(__dirname, '..', 'vite.config.js'),
  9. base: './',
  10. mode: 'production'
  11. });
  12. }
  13. function buildMain() {
  14. const mainPath = Path.join(__dirname, '..', 'src', 'main');
  15. return compileTs(mainPath);
  16. }
  17. FileSystem.rmSync(Path.join(__dirname, '..', 'build'), {
  18. recursive: true,
  19. force: true,
  20. })
  21. console.log(Chalk.blueBright('Transpiling renderer & main...'));
  22. Promise.allSettled([
  23. buildRenderer(),
  24. buildMain(),
  25. ]).then(() => {
  26. console.log(Chalk.greenBright('Renderer & main successfully transpiled! (ready to be built with electron-builder)'));
  27. });