Skip to content

Commit 0af1be0

Browse files
authored
Move browser demo static assets to public/ for Vite (#3215)
The Vite migration removed the copy-assets.js script but didn't move audio/ and image/ files into public/ (Vite's publicDir). This caused speech.mp3, speech_stereo.mp3, and beach.jpg to be missing from dist/ after build. - Move audio/*.mp3 and image/*.jpg to public/ - Remove /public/ from .gitignore (was preventing tracking) - Consolidate REFERENCES.md with all attribution info - Remove now-empty audio/ and image/ directories
1 parent 05da7e2 commit 0af1be0

8 files changed

Lines changed: 12 additions & 14 deletions

File tree

demos/browser/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
/debug.js
2-
/public/

demos/browser/audio/REFERENCES.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

demos/browser/image/license.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

demos/browser/public/REFERENCES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
File | Source
2+
---- | ------
3+
speech.mp3 | Excerpt from speech by Barack Obama, November 20, 2014. Source: The White House. President Obama delivers an address to the nation on immigration. https://millercenter.org/the-presidency/presidential-speeches/november-20-2014-address-nation-immigration
4+
speech_stereo.mp3 | Audio test file for stereo verification
5+
beach.jpg | Licensed under the Creative Commons Attribution 2.0 Generic license. Author: Familydestinationsguide.com Images. https://commons.wikimedia.org/wiki/File:Hotels_Lined_up_Along_a_Beach_Illustration.jpg

script/generate-media-transform-worker-code.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ function runCommandWithLogs(command) {
4848
}
4949
}
5050

51+
// If the output directory was cleaned but the tsbuildinfo persists, tsc --build
52+
// will incorrectly skip compilation. Delete the tsbuildinfo in that case.
53+
const tsBuildInfoPath = `${configDir}/tsconfig.mediatransformworker.tsbuildinfo`;
54+
if (!fs.existsSync('./build/mediatransformworker') && fs.existsSync(tsBuildInfoPath)) {
55+
fs.unlinkSync(tsBuildInfoPath);
56+
}
57+
5158
// Transpile media transform worker TypeScript files.
5259
// Note: prebuild runs via npm lifecycle before build, so node_modules is already available
5360
let tscPath = path.resolve(`${execSync('npm root').toString().trim()}/.bin/tsc`);

0 commit comments

Comments
 (0)