dev : live reload avec BrowserSync + serveur PHP intégré
npm run serve démarre php -S localhost:8000 et BrowserSync en parallèle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7e55d445f5
commit
2d1bd566ba
3 changed files with 2073 additions and 0 deletions
15
browsersync.js
Normal file
15
browsersync.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
const browserSync = require("browser-sync");
|
||||
const syncOptions = require("./package.json").browserSync;
|
||||
const filesToWatch = syncOptions.watch || [];
|
||||
const filesToIgnore = syncOptions.ignore || [];
|
||||
const proxy = syncOptions.proxy;
|
||||
|
||||
const sync = browserSync.create();
|
||||
|
||||
sync.init({
|
||||
watch: true,
|
||||
proxy,
|
||||
files: filesToWatch,
|
||||
ignore: filesToIgnore,
|
||||
open: "local",
|
||||
});
|
||||
2022
package-lock.json
generated
Normal file
2022
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
36
package.json
Normal file
36
package.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "hecq-lesort",
|
||||
"version": "1.0.0",
|
||||
"description": "<img src=\"http://getkirby.com/assets/images/github/plainkit.jpg\" width=\"300\">",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"serve": "concurrently \"npm run serve-php\" \"npm run sync\"",
|
||||
"serve-php": "php -S localhost:8000 kirby/router.php",
|
||||
"sync": "node browsersync.js"
|
||||
},
|
||||
"browserSync": {
|
||||
"proxy": "localhost:8000",
|
||||
"watch": [
|
||||
"assets",
|
||||
"content",
|
||||
"site/snippets",
|
||||
"site/templates",
|
||||
"site/blueprints",
|
||||
"site/languages"
|
||||
],
|
||||
"ignore": [
|
||||
"**/.lock",
|
||||
"**/.DS_Store"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@forge.studio-variable.com/studio-variable/hecq-et-lesort.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"browser-sync": "^3.0.4",
|
||||
"concurrently": "^10.0.3"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue