davanstrien HF Staff commited on
Commit
44acf59
·
verified ·
1 Parent(s): 0f194ff

Build: vendor MP3 encoder

Browse files
Files changed (1) hide show
  1. scripts/build.mjs +6 -1
scripts/build.mjs CHANGED
@@ -9,7 +9,7 @@ import { writeIcons } from './icons.mjs';
9
  const root = new URL('..', import.meta.url).pathname;
10
  const dist = join(root, 'dist');
11
  const pkg = join(root, 'node_modules', 'phonon-tts');
12
- if (!existsSync(pkg)) execSync('npm install --no-audit --no-fund', { cwd: root, stdio: 'inherit' });
13
 
14
  rmSync(dist, { recursive: true, force: true });
15
  mkdirSync(dist);
@@ -26,6 +26,11 @@ for (const f of readdirSync(pkg)) {
26
  }
27
  }
28
 
 
 
 
 
 
29
  const files = [];
30
  const walk = (d) => readdirSync(d).forEach((n) => { const p = join(d, n); statSync(p).isDirectory() ? walk(p) : files.push(p); });
31
  walk(dist);
 
9
  const root = new URL('..', import.meta.url).pathname;
10
  const dist = join(root, 'dist');
11
  const pkg = join(root, 'node_modules', 'phonon-tts');
12
+ if (!existsSync(pkg) || !existsSync(join(root, 'node_modules', '@breezystack', 'lamejs'))) execSync('npm install --no-audit --no-fund', { cwd: root, stdio: 'inherit' });
13
 
14
  rmSync(dist, { recursive: true, force: true });
15
  mkdirSync(dist);
 
26
  }
27
  }
28
 
29
+ const lame = join(root, 'node_modules', '@breezystack', 'lamejs');
30
+ mkdirSync(join(dist, 'vendor', 'lamejs'), { recursive: true });
31
+ cpSync(join(lame, 'dist', 'lamejs.js'), join(dist, 'vendor', 'lamejs', 'lamejs.js'));
32
+ if (existsSync(join(lame, 'LICENSE'))) cpSync(join(lame, 'LICENSE'), join(dist, 'vendor', 'lamejs', 'LICENSE'));
33
+
34
  const files = [];
35
  const walk = (d) => readdirSync(d).forEach((n) => { const p = join(d, n); statSync(p).isDirectory() ? walk(p) : files.push(p); });
36
  walk(dist);