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",
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue