@intlayer/webpack 4.1.9 → 4.1.10

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.
@@ -23,12 +23,17 @@ __export(webpack_plugin_exports, {
23
23
  module.exports = __toCommonJS(webpack_plugin_exports);
24
24
  var import_chokidar = require("@intlayer/chokidar");
25
25
  class IntlayerPlugin {
26
+ isWatching = false;
27
+ // Flag to ensure we only start the watcher once
26
28
  async apply(compiler) {
27
29
  compiler.hooks.beforeCompile.tapPromise("IntlayerPlugin", async () => {
28
- try {
29
- await (0, import_chokidar.buildAndWatchIntlayer)();
30
- } catch (error) {
31
- console.error("Error in IntlayerPlugin:", error);
30
+ if (!this.isWatching) {
31
+ try {
32
+ await (0, import_chokidar.buildAndWatchIntlayer)();
33
+ this.isWatching = true;
34
+ } catch (error) {
35
+ console.error("Error in IntlayerPlugin:", error);
36
+ }
32
37
  }
33
38
  });
34
39
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { buildAndWatchIntlayer } from '@intlayer/chokidar';\nimport { Compiler } from 'webpack';\n\n// Watch mode or on time build\nexport class IntlayerPlugin {\n async apply(compiler: Compiler): Promise<void> {\n compiler.hooks.beforeCompile.tapPromise('IntlayerPlugin', async () => {\n try {\n await buildAndWatchIntlayer();\n } catch (error) {\n console.error('Error in IntlayerPlugin:', error);\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsC;AAI/B,MAAM,eAAe;AAAA,EAC1B,MAAM,MAAM,UAAmC;AAC7C,aAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;AACpE,UAAI;AACF,kBAAM,uCAAsB;AAAA,MAC9B,SAAS,OAAO;AACd,gBAAQ,MAAM,4BAA4B,KAAK;AAAA,MACjD;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { buildAndWatchIntlayer } from '@intlayer/chokidar';\nimport { Compiler } from 'webpack';\n\n// Watch mode or on time build\nexport class IntlayerPlugin {\n private isWatching = false; // Flag to ensure we only start the watcher once\n\n async apply(compiler: Compiler): Promise<void> {\n compiler.hooks.beforeCompile.tapPromise('IntlayerPlugin', async () => {\n if (!this.isWatching) {\n try {\n await buildAndWatchIntlayer();\n this.isWatching = true;\n } catch (error) {\n console.error('Error in IntlayerPlugin:', error);\n }\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsC;AAI/B,MAAM,eAAe;AAAA,EAClB,aAAa;AAAA;AAAA,EAErB,MAAM,MAAM,UAAmC;AAC7C,aAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;AACpE,UAAI,CAAC,KAAK,YAAY;AACpB,YAAI;AACF,oBAAM,uCAAsB;AAC5B,eAAK,aAAa;AAAA,QACpB,SAAS,OAAO;AACd,kBAAQ,MAAM,4BAA4B,KAAK;AAAA,QACjD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -1,11 +1,16 @@
1
1
  import { buildAndWatchIntlayer } from "@intlayer/chokidar";
2
2
  class IntlayerPlugin {
3
+ isWatching = false;
4
+ // Flag to ensure we only start the watcher once
3
5
  async apply(compiler) {
4
6
  compiler.hooks.beforeCompile.tapPromise("IntlayerPlugin", async () => {
5
- try {
6
- await buildAndWatchIntlayer();
7
- } catch (error) {
8
- console.error("Error in IntlayerPlugin:", error);
7
+ if (!this.isWatching) {
8
+ try {
9
+ await buildAndWatchIntlayer();
10
+ this.isWatching = true;
11
+ } catch (error) {
12
+ console.error("Error in IntlayerPlugin:", error);
13
+ }
9
14
  }
10
15
  });
11
16
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { buildAndWatchIntlayer } from '@intlayer/chokidar';\nimport { Compiler } from 'webpack';\n\n// Watch mode or on time build\nexport class IntlayerPlugin {\n async apply(compiler: Compiler): Promise<void> {\n compiler.hooks.beforeCompile.tapPromise('IntlayerPlugin', async () => {\n try {\n await buildAndWatchIntlayer();\n } catch (error) {\n console.error('Error in IntlayerPlugin:', error);\n }\n });\n }\n}\n"],"mappings":"AAAA,SAAS,6BAA6B;AAI/B,MAAM,eAAe;AAAA,EAC1B,MAAM,MAAM,UAAmC;AAC7C,aAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;AACpE,UAAI;AACF,cAAM,sBAAsB;AAAA,MAC9B,SAAS,OAAO;AACd,gBAAQ,MAAM,4BAA4B,KAAK;AAAA,MACjD;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { buildAndWatchIntlayer } from '@intlayer/chokidar';\nimport { Compiler } from 'webpack';\n\n// Watch mode or on time build\nexport class IntlayerPlugin {\n private isWatching = false; // Flag to ensure we only start the watcher once\n\n async apply(compiler: Compiler): Promise<void> {\n compiler.hooks.beforeCompile.tapPromise('IntlayerPlugin', async () => {\n if (!this.isWatching) {\n try {\n await buildAndWatchIntlayer();\n this.isWatching = true;\n } catch (error) {\n console.error('Error in IntlayerPlugin:', error);\n }\n }\n });\n }\n}\n"],"mappings":"AAAA,SAAS,6BAA6B;AAI/B,MAAM,eAAe;AAAA,EAClB,aAAa;AAAA;AAAA,EAErB,MAAM,MAAM,UAAmC;AAC7C,aAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;AACpE,UAAI,CAAC,KAAK,YAAY;AACpB,YAAI;AACF,gBAAM,sBAAsB;AAC5B,eAAK,aAAa;AAAA,QACpB,SAAS,OAAO;AACd,kBAAQ,MAAM,4BAA4B,KAAK;AAAA,QACjD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -1,5 +1,6 @@
1
1
  import { Compiler } from 'webpack';
2
2
  export declare class IntlayerPlugin {
3
+ private isWatching;
3
4
  apply(compiler: Compiler): Promise<void>;
4
5
  }
5
6
  //# sourceMappingURL=webpack-plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-plugin.d.ts","sourceRoot":"","sources":["../../src/webpack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,qBAAa,cAAc;IACnB,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAS/C"}
1
+ {"version":3,"file":"webpack-plugin.d.ts","sourceRoot":"","sources":["../../src/webpack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,qBAAa,cAAc;IACzB,OAAO,CAAC,UAAU,CAAS;IAErB,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAY/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/webpack",
3
- "version": "4.1.9",
3
+ "version": "4.1.10",
4
4
  "private": false,
5
5
  "description": "Webpack plugin for seamless integration with Intlayer, enhancing JavaScript apps built with React, Next.js and more.",
6
6
  "keywords": [
@@ -60,8 +60,8 @@
60
60
  "fast-glob": "^3.3.3",
61
61
  "webpack": "^5.97.1",
62
62
  "webpack-dev-server": "^5.2.0",
63
- "@intlayer/config": "4.1.9",
64
- "@intlayer/chokidar": "4.1.9"
63
+ "@intlayer/chokidar": "4.1.10",
64
+ "@intlayer/config": "4.1.10"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@changesets/cli": "2.27.12",
@@ -75,15 +75,15 @@
75
75
  "tsc-alias": "^1.8.10",
76
76
  "tsup": "^8.3.5",
77
77
  "typescript": "^5.7.3",
78
- "@utils/eslint-config": "1.0.4",
79
78
  "@utils/ts-config": "1.0.4",
79
+ "@utils/ts-config-types": "1.0.4",
80
80
  "@utils/tsup-config": "1.0.4",
81
- "@utils/ts-config-types": "1.0.4"
81
+ "@utils/eslint-config": "1.0.4"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "webpack": "^5.96.1",
85
- "@intlayer/chokidar": "4.1.9",
86
- "@intlayer/config": "4.1.9"
85
+ "@intlayer/chokidar": "4.1.10",
86
+ "@intlayer/config": "4.1.10"
87
87
  },
88
88
  "engines": {
89
89
  "node": ">=14.18"