@intlayer/webpack 4.1.10 → 4.1.11

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.
@@ -22,14 +22,19 @@ __export(webpack_plugin_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(webpack_plugin_exports);
24
24
  var import_chokidar = require("@intlayer/chokidar");
25
+ var import_config = require("@intlayer/config");
25
26
  class IntlayerPlugin {
26
27
  isWatching = false;
27
- // Flag to ensure we only start the watcher once
28
+ // Flag to ensure we only start the watcher after the first build
29
+ configuration = (0, import_config.getConfiguration)();
28
30
  async apply(compiler) {
31
+ if (this.configuration.content.watch) {
32
+ (0, import_chokidar.watch)(this.configuration);
33
+ }
29
34
  compiler.hooks.beforeCompile.tapPromise("IntlayerPlugin", async () => {
30
35
  if (!this.isWatching) {
31
36
  try {
32
- await (0, import_chokidar.buildAndWatchIntlayer)();
37
+ await (0, import_chokidar.prepareIntlayer)(this.configuration);
33
38
  this.isWatching = true;
34
39
  } catch (error) {
35
40
  console.error("Error in IntlayerPlugin:", error);
@@ -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 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
+ {"version":3,"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { prepareIntlayer, watch } from '@intlayer/chokidar';\nimport { getConfiguration } from '@intlayer/config';\nimport type { 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 after the first build\n private configuration = getConfiguration();\n\n async apply(compiler: Compiler): Promise<void> {\n if (this.configuration.content.watch) {\n // Start watching (assuming watch is also async)\n watch(this.configuration);\n }\n\n compiler.hooks.beforeCompile.tapPromise('IntlayerPlugin', async () => {\n if (!this.isWatching) {\n try {\n await prepareIntlayer(this.configuration);\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,sBAAuC;AACvC,oBAAiC;AAI1B,MAAM,eAAe;AAAA,EAClB,aAAa;AAAA;AAAA,EACb,oBAAgB,gCAAiB;AAAA,EAEzC,MAAM,MAAM,UAAmC;AAC7C,QAAI,KAAK,cAAc,QAAQ,OAAO;AAEpC,iCAAM,KAAK,aAAa;AAAA,IAC1B;AAEA,aAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;AACpE,UAAI,CAAC,KAAK,YAAY;AACpB,YAAI;AACF,oBAAM,iCAAgB,KAAK,aAAa;AACxC,eAAK,aAAa;AAAA,QACpB,SAAS,OAAO;AACd,kBAAQ,MAAM,4BAA4B,KAAK;AAAA,QACjD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -1,12 +1,17 @@
1
- import { buildAndWatchIntlayer } from "@intlayer/chokidar";
1
+ import { prepareIntlayer, watch } from "@intlayer/chokidar";
2
+ import { getConfiguration } from "@intlayer/config";
2
3
  class IntlayerPlugin {
3
4
  isWatching = false;
4
- // Flag to ensure we only start the watcher once
5
+ // Flag to ensure we only start the watcher after the first build
6
+ configuration = getConfiguration();
5
7
  async apply(compiler) {
8
+ if (this.configuration.content.watch) {
9
+ watch(this.configuration);
10
+ }
6
11
  compiler.hooks.beforeCompile.tapPromise("IntlayerPlugin", async () => {
7
12
  if (!this.isWatching) {
8
13
  try {
9
- await buildAndWatchIntlayer();
14
+ await prepareIntlayer(this.configuration);
10
15
  this.isWatching = true;
11
16
  } catch (error) {
12
17
  console.error("Error in IntlayerPlugin:", error);
@@ -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 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
+ {"version":3,"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { prepareIntlayer, watch } from '@intlayer/chokidar';\nimport { getConfiguration } from '@intlayer/config';\nimport type { 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 after the first build\n private configuration = getConfiguration();\n\n async apply(compiler: Compiler): Promise<void> {\n if (this.configuration.content.watch) {\n // Start watching (assuming watch is also async)\n watch(this.configuration);\n }\n\n compiler.hooks.beforeCompile.tapPromise('IntlayerPlugin', async () => {\n if (!this.isWatching) {\n try {\n await prepareIntlayer(this.configuration);\n this.isWatching = true;\n } catch (error) {\n console.error('Error in IntlayerPlugin:', error);\n }\n }\n });\n }\n}\n"],"mappings":"AAAA,SAAS,iBAAiB,aAAa;AACvC,SAAS,wBAAwB;AAI1B,MAAM,eAAe;AAAA,EAClB,aAAa;AAAA;AAAA,EACb,gBAAgB,iBAAiB;AAAA,EAEzC,MAAM,MAAM,UAAmC;AAC7C,QAAI,KAAK,cAAc,QAAQ,OAAO;AAEpC,YAAM,KAAK,aAAa;AAAA,IAC1B;AAEA,aAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;AACpE,UAAI,CAAC,KAAK,YAAY;AACpB,YAAI;AACF,gBAAM,gBAAgB,KAAK,aAAa;AACxC,eAAK,aAAa;AAAA,QACpB,SAAS,OAAO;AACd,kBAAQ,MAAM,4BAA4B,KAAK;AAAA,QACjD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -1,6 +1,7 @@
1
- import { Compiler } from 'webpack';
1
+ import type { Compiler } from 'webpack';
2
2
  export declare class IntlayerPlugin {
3
3
  private isWatching;
4
+ private configuration;
4
5
  apply(compiler: Compiler): Promise<void>;
5
6
  }
6
7
  //# 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;IACzB,OAAO,CAAC,UAAU,CAAS;IAErB,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAY/C"}
1
+ {"version":3,"file":"webpack-plugin.d.ts","sourceRoot":"","sources":["../../src/webpack-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,qBAAa,cAAc;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAsB;IAErC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAiB/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/webpack",
3
- "version": "4.1.10",
3
+ "version": "4.1.11",
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/chokidar": "4.1.10",
64
- "@intlayer/config": "4.1.10"
63
+ "@intlayer/chokidar": "4.1.11",
64
+ "@intlayer/config": "4.1.11"
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/ts-config": "1.0.4",
79
- "@utils/ts-config-types": "1.0.4",
78
+ "@utils/eslint-config": "1.0.4",
80
79
  "@utils/tsup-config": "1.0.4",
81
- "@utils/eslint-config": "1.0.4"
80
+ "@utils/ts-config-types": "1.0.4",
81
+ "@utils/ts-config": "1.0.4"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "webpack": "^5.96.1",
85
- "@intlayer/chokidar": "4.1.10",
86
- "@intlayer/config": "4.1.10"
85
+ "@intlayer/chokidar": "4.1.11",
86
+ "@intlayer/config": "4.1.11"
87
87
  },
88
88
  "engines": {
89
89
  "node": ">=14.18"