sdc-build-wp 3.5.0 → 3.5.2

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.
@@ -3,7 +3,7 @@ import { create as bsCreate } from 'browser-sync';
3
3
  const browserSync = bsCreate();
4
4
 
5
5
  const buildBrowserSync = () => {
6
- browserSync.init({
6
+ let bsOptions = {
7
7
  logPrefix: '',
8
8
  port: project.package.sdc?.port || 3000,
9
9
  proxy: project.package.sdc?.browsersync?.localProxyURL,
@@ -32,16 +32,19 @@ const buildBrowserSync = () => {
32
32
  bottom: '0',
33
33
  borderRadius: '5px 0px 0px'
34
34
  }
35
- },
36
- snippetOptions: {
35
+ }
36
+ };
37
+ if (project.package.sdc?.browsersync?.location == 'end') {
38
+ bsOptions.snippetOptions = {
37
39
  rule: {
38
40
  match: /<\/body>/i,
39
41
  fn: function (snippet, match) {
40
42
  return snippet + match;
41
43
  }
42
44
  }
43
- }
44
- });
45
+ };
46
+ }
47
+ browserSync.init(bsOptions);
45
48
  };
46
49
 
47
50
  export default buildBrowserSync;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "sdc-build-wp",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "description": "Custom WordPress build process.",
5
5
  "engines": {
6
- "node": "^20"
6
+ "node": ">=20"
7
7
  },
8
8
  "author": {
9
9
  "name": "Robert Sefer",