diff --git a/_scripts/dev-runner.js b/_scripts/dev-runner.js index 679b7b6e..96dc2772 100644 --- a/_scripts/dev-runner.js +++ b/_scripts/dev-runner.js @@ -116,7 +116,12 @@ function startRenderer(callback) { }) const server = new WebpackDevServer(compiler, { - static: path.join(process.cwd(), 'static'), + static: { + directory: path.join(process.cwd(), 'static'), + watch: { + ignored: /(dashFiles|storyboards)\/*/ + } + }, port }) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 67f5ac42..dc6d78b0 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -960,13 +960,13 @@ export default Vue.extend({ if (this.removeVideoMetaFiles) { const userData = await this.getUserDataPath() if (this.isDev) { - const dashFileLocation = `dashFiles/${this.videoId}.xml` - const vttFileLocation = `storyboards/${this.videoId}.vtt` + const dashFileLocation = `static/dashFiles/${this.videoId}.xml` + const vttFileLocation = `static/storyboards/${this.videoId}.vtt` // only delete the file it actually exists - if (fs.existsSync('dashFiles/') && fs.existsSync(dashFileLocation)) { + if (fs.existsSync('static/dashFiles/') && fs.existsSync(dashFileLocation)) { fs.rmSync(dashFileLocation) } - if (fs.existsSync('storyboards/') && fs.existsSync(vttFileLocation)) { + if (fs.existsSync('static/storyboards/') && fs.existsSync(vttFileLocation)) { fs.rmSync(vttFileLocation) } } else { @@ -1014,9 +1014,10 @@ export default Vue.extend({ fs.mkdirSync('static/dashFiles/') } - fs.rm(fileLocation, () => { - fs.writeFileSync(fileLocation, xmlData) - }) + if (fs.existsSync(fileLocation)) { + fs.rmSync(fileLocation) + } + fs.writeFileSync(fileLocation, xmlData) } else { fileLocation = `${userData}/dashFiles/${this.videoId}.xml` uriSchema = `file://${fileLocation}`