sdc-build-wp 4.5.6 → 4.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/server.js +22 -9
- package/package.json +9 -10
package/lib/components/server.js
CHANGED
@@ -1,21 +1,25 @@
|
|
1
1
|
import BaseComponent from './base.js';
|
2
|
-
import { create
|
2
|
+
import { create } from 'browser-sync';
|
3
3
|
|
4
4
|
export default class ServerComponent extends BaseComponent {
|
5
5
|
|
6
6
|
constructor() {
|
7
7
|
super();
|
8
8
|
this.description = `Run a dev proxy server for live reloading`;
|
9
|
-
this.server =
|
9
|
+
this.server = create('SDC WP Build Server');
|
10
10
|
this.watchedFiles = [
|
11
|
-
`${this.project.
|
12
|
-
|
13
|
-
|
14
|
-
`${this.project.path}/**/*.json`,
|
11
|
+
`${this.project.paths.dist}/**/*`,
|
12
|
+
`**/*.html`,
|
13
|
+
`**/*.json`
|
15
14
|
];
|
16
15
|
if (!this.project.shouldPHPLint) {
|
17
|
-
this.watchedFiles.push(
|
16
|
+
this.watchedFiles.push(`**/*.php`);
|
18
17
|
}
|
18
|
+
this.ignoredFiles = [
|
19
|
+
`node_modules/**/*`,
|
20
|
+
`vendor/**/*`,
|
21
|
+
`**/*.map`
|
22
|
+
];
|
19
23
|
}
|
20
24
|
|
21
25
|
async init() {
|
@@ -25,9 +29,15 @@ export default class ServerComponent extends BaseComponent {
|
|
25
29
|
serve(watch = false) {
|
26
30
|
let bsOptions = {
|
27
31
|
logPrefix: '',
|
32
|
+
logFileChanges: false,
|
28
33
|
port: this.project.package.sdc?.port || 3000,
|
29
34
|
proxy: this.project.package.sdc?.browsersync?.localProxyURL,
|
30
35
|
files: watch ? this.watchedFiles : [],
|
36
|
+
watchOptions: {
|
37
|
+
cwd: this.project.path,
|
38
|
+
ignored: this.ignoredFiles,
|
39
|
+
ignoreInitial: true
|
40
|
+
},
|
31
41
|
reloadDelay: 250,
|
32
42
|
reloadDebounce: 1000,
|
33
43
|
reloadOnRestart: true,
|
@@ -65,9 +75,12 @@ export default class ServerComponent extends BaseComponent {
|
|
65
75
|
|
66
76
|
async watch() {
|
67
77
|
this.server.watch(this.watchedFiles, (event, file) => {
|
68
|
-
if (
|
78
|
+
if (['add', 'addDir', 'change'].includes(event)) {
|
69
79
|
this.server.reload(file);
|
70
|
-
|
80
|
+
if (file.split('.').pop() == 'css') {
|
81
|
+
this.server.notify('Style injected', 500);
|
82
|
+
}
|
83
|
+
} else if (['unlink', 'unlinkDir'].includes(event)) {
|
71
84
|
this.server.reload();
|
72
85
|
}
|
73
86
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "sdc-build-wp",
|
3
|
-
"version": "4.5.
|
3
|
+
"version": "4.5.7",
|
4
4
|
"description": "Custom WordPress build process.",
|
5
5
|
"engines": {
|
6
6
|
"node": ">=22"
|
@@ -23,25 +23,24 @@
|
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
25
|
"@stylistic/stylelint-plugin": "^3.1.2",
|
26
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
27
|
-
"@typescript-eslint/parser": "^8.
|
28
|
-
"@wordpress/scripts": "^30.
|
26
|
+
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
27
|
+
"@typescript-eslint/parser": "^8.35.0",
|
28
|
+
"@wordpress/scripts": "^30.19.0",
|
29
29
|
"autoprefixer": "^10.4.21",
|
30
30
|
"browser-sync": "^3.0.4",
|
31
31
|
"chalk": "^5.4.1",
|
32
32
|
"chokidar": "^4.0.3",
|
33
33
|
"esbuild": "^0.25.5",
|
34
|
-
"eslint": "^9.
|
34
|
+
"eslint": "^9.29.0",
|
35
35
|
"fs-extra": "^11.3.0",
|
36
|
-
"jiti": "^2.4.2",
|
37
36
|
"minimist": "^1.2.8",
|
38
|
-
"postcss": "^8.5.
|
37
|
+
"postcss": "^8.5.6",
|
39
38
|
"postcss-scss": "^4.0.9",
|
40
39
|
"postcss-sort-media-queries": "^5.2.0",
|
41
|
-
"sass": "^1.89.
|
40
|
+
"sass": "^1.89.2",
|
42
41
|
"sharp": "^0.34.2",
|
43
|
-
"stylelint": "^16.
|
44
|
-
"svgo": "^
|
42
|
+
"stylelint": "^16.21.0",
|
43
|
+
"svgo": "^4.0.0",
|
45
44
|
"tail": "^2.2.6"
|
46
45
|
}
|
47
46
|
}
|