@salla.sa/twilight 2.0.311 → 2.0.312

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/watcher.js +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight",
3
- "version": "2.0.311",
3
+ "version": "2.0.312",
4
4
  "description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/watcher.js CHANGED
@@ -110,13 +110,14 @@ class WatcherPlugin {
110
110
  let files = this.isWebpack5
111
111
  ? Array.from(compiler_.modifiedFiles || [])
112
112
  : Object.keys(compiler_.watchFileSystem.watcher.mtimes);
113
-
113
+ let changes = false;
114
114
  files.map((file)=>{
115
- if(file.toLowerCase().endsWith('.twig'))
115
+ if(file.toLowerCase().endsWith('.twig')){
116
116
  execSync(`${this.sallaCli} theme sync -f "${file}" -id ${this.theme_id} -store_id ${this.store_id} -draft_id ${this.draft_id} -upload_url ${this.upload_url}`, {stdio: 'inherit'});
117
-
118
- if(this.connection) this.connection.sendUTF(JSON.stringify({msg:"reload"}));
117
+ changes = true;
118
+ }
119
119
  });
120
+ if(changes) this.connection.sendUTF(JSON.stringify({msg:"reload"}));
120
121
  }
121
122
  );
122
123
  }