Fixed reloading of browser when developing

This commit is contained in:
2025-09-20 18:45:49 +02:00
parent 03e2361798
commit 2658d688ca
5 changed files with 1271 additions and 691 deletions

10
bs-config.cjs Normal file
View File

@@ -0,0 +1,10 @@
module.exports = {
port: 3000,
server: "./dist",
files: "./dist/**/*",
watchOptions: {
usePolling: true,
interval: 200,
binaryInterval: 200
}
}

1929
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,9 +6,9 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"dev": "concurrently --kill-others -n Build,Serve -c auto \"npm run watch-build\" \"npm run serve\"", "dev": "concurrently --kill-others -n Build,Serve -c auto \"npm run watch-build\" \"npm run serve\"",
"watch-build": "nodemon --ext js,ts,json,md,html --watch notes --watch src --watch packages/@zblog/toolchain/src --watch markdown.ts --exec \"npm run build --workspaces && npm run build && npm run generate-blog\"", "watch-build": "nodemon --ext js,ts,json,md,html --watch notes --watch src --watch templates --watch packages/@zblog/toolchain/src --watch markdown.ts --exec \"npm run build --workspaces && npm run build && npm run generate-blog\"",
"build": "tsc -p tsconfig.json", "build": "tsc -p tsconfig.json",
"serve": "serve dist", "serve": "browser-sync start --config bs-config.cjs",
"generate-blog": "node bin/index.js", "generate-blog": "node bin/index.js",
"initialize-firebase": "npm install -g firebase-tools && firebase login", "initialize-firebase": "npm install -g firebase-tools && firebase login",
"deploy": "npm run generate-blog && firebase deploy" "deploy": "npm run generate-blog && firebase deploy"
@@ -20,9 +20,9 @@
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@types/node": "^20.11.5", "@types/node": "^20.11.5",
"browser-sync": "^3.0.4",
"concurrently": "^8.2.1", "concurrently": "^8.2.1",
"nodemon": "^3.0.1", "nodemon": "^3.0.1",
"serve": "^14.2.1",
"typescript": "^5.3.3" "typescript": "^5.3.3"
} }
} }

View File

@@ -23,6 +23,7 @@ export class StartPagePlugin implements IPluginBuilder {
${links.join("")} ${links.join("")}
`; `;
htmlTemplate = htmlTemplate.replace("{{content}}", html); htmlTemplate = htmlTemplate.replace("{{content}}", html);
console.log("Generating index", this.options.indexTemplatePath);
writeTextAsFile( writeTextAsFile(
`${builderContext.outputDirectory}/index.html`, `${builderContext.outputDirectory}/index.html`,
htmlTemplate htmlTemplate

View File

@@ -7,7 +7,7 @@
<title>Document</title> <title>Document</title>
<style> <style>
html { html {
font-size: 17px; font-size: 18px;
line-height: 26px; line-height: 26px;
display: flex; display: flex;
justify-content: center; justify-content: center;