mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Added prototype for bundling files.
This commit is contained in:
parent
5809e9286f
commit
ffe40b82c9
13 changed files with 579 additions and 72 deletions
21
ui/copyProdPadFiles.js
Normal file
21
ui/copyProdPadFiles.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import {fileURLToPath} from "url";
|
||||
import {dirname} from "path";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
let padHtml = fs.readFileSync(path.join(__dirname, "..", "src", "templates", "pad_template.html"), 'utf8');
|
||||
const OUTPUT_PATH = path.join(__dirname, "..", "src", "templates", "pad.html");
|
||||
// Walk directory and find pad js file
|
||||
let padJsFile = "";
|
||||
const walkSync = (dir) => {
|
||||
fs.readdirSync(dir).forEach(file => {
|
||||
if (file.startsWith("pad-")) {
|
||||
padJsFile = file;
|
||||
}
|
||||
})}
|
||||
walkSync(path.join(__dirname, "..", "src", "static", "oidc", "assets"))
|
||||
console.log(padJsFile)
|
||||
padHtml = padHtml.replace("PLACEHOLDER_FOR_PAD_JS", `../../views/assets/${padJsFile}?callback=require.define`);
|
||||
fs.writeFileSync(OUTPUT_PATH, padHtml);
|
Loading…
Add table
Add a link
Reference in a new issue