refactor
This commit is contained in:
1
browser-sync/.dockerignore
Normal file
1
browser-sync/.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
6
browser-sync/Dockerfile
Normal file
6
browser-sync/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM node:18
|
||||
WORKDIR /usr/src/app
|
||||
COPY . .
|
||||
RUN npm ci
|
||||
EXPOSE 3000
|
||||
CMD ["node", "index.js"]
|
||||
20
browser-sync/index.js
Normal file
20
browser-sync/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const bs = require("browser-sync").create();
|
||||
|
||||
bs.watch("dist/styles.css", (e) => {
|
||||
if (e === "change") {
|
||||
bs.reload("styles.css");
|
||||
}
|
||||
});
|
||||
|
||||
bs.watch("dist/bundle.js", (e) => {
|
||||
if (e === "change") {
|
||||
bs.reload("bundle.js");
|
||||
}
|
||||
});
|
||||
|
||||
bs.watch("dist/**/*.php", () => bs.reload());
|
||||
|
||||
bs.init({
|
||||
open: false,
|
||||
proxy: "http://windycoys_wordpress",
|
||||
});
|
||||
2970
browser-sync/package-lock.json
generated
Normal file
2970
browser-sync/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
browser-sync/package.json
Normal file
11
browser-sync/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "windycoys-browser-sync",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "Browsersync Docker container for local developement",
|
||||
"main": "index.js",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"browser-sync": "^2.27.9"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user