mirror of
https://github.com/6c65726f79/Transmissionic
synced 2026-11-26 09:48:23 +08:00
24 lines
645 B
JavaScript
24 lines
645 B
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* This script need to be run before building the WebUI
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
|
|
function updateJS(filename) {
|
|
fs.readFile(`${filename}`, 'utf8', function(err, data) {
|
|
if (err) {
|
|
return console.log(err);
|
|
}
|
|
|
|
// Force Vue.js/webpack to load scripts from the same directory (to use the WebUI from /transmission/web/)
|
|
const result = data.replace(/\${RuntimeGlobals.publicPath} \+ /g, "");
|
|
|
|
fs.writeFile(`${filename}`, result, 'utf8', function(error) {
|
|
if (error) return console.log(error);
|
|
});
|
|
});
|
|
}
|
|
|
|
updateJS('./node_modules/webpack/lib/web/JsonpChunkLoadingRuntimeModule.js') |