@intlayer/webpack 9.0.0-canary.9 → 9.0.1

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.
@@ -1,12 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- let _intlayer_chokidar_listDictionaries = require("@intlayer/chokidar/listDictionaries");
4
- let _intlayer_chokidar_utils = require("@intlayer/chokidar/utils");
2
+ let _intlayer_engine_listDictionaries = require("@intlayer/engine/listDictionaries");
3
+ let _intlayer_engine_utils = require("@intlayer/engine/utils");
5
4
 
6
5
  //#region src/getEntries.ts
7
6
  const getEntries = async (configuration) => {
8
- return (await (0, _intlayer_chokidar_listDictionaries.listDictionaries)(configuration)).reduce((obj, el) => {
9
- const hash = (0, _intlayer_chokidar_utils.getPathHash)(el);
7
+ return (await (0, _intlayer_engine_listDictionaries.listDictionaries)(configuration)).reduce((obj, el) => {
8
+ const hash = (0, _intlayer_engine_utils.getPathHash)(el);
10
9
  obj[`intlayer-content/${hash}`] = {
11
10
  import: el,
12
11
  dependOn: void 0
@@ -1 +1 @@
1
- {"version":3,"file":"getEntries.cjs","names":[],"sources":["../../src/getEntries.ts"],"sourcesContent":["import { listDictionaries } from '@intlayer/chokidar/listDictionaries';\nimport { getPathHash } from '@intlayer/chokidar/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { EntryObject } from 'webpack';\n\nexport const getEntries = async (\n configuration: IntlayerConfig\n): Promise<EntryObject> => {\n const files = await listDictionaries(configuration);\n\n return files.reduce((obj, el) => {\n const hash = getPathHash(el);\n\n obj[`intlayer-content/${hash}`] = {\n import: el,\n dependOn: undefined,\n };\n\n return obj;\n }, {} as EntryObject);\n};\n"],"mappings":";;;;;;AAKA,MAAa,aAAa,OACxB,kBACyB;AAGzB,SAAO,gEAF8B,cAAc,EAEtC,QAAQ,KAAK,OAAO;EAC/B,MAAM,iDAAmB,GAAG;AAE5B,MAAI,oBAAoB,UAAU;GAChC,QAAQ;GACR,UAAU;GACX;AAED,SAAO;IACN,EAAE,CAAgB"}
1
+ {"version":3,"file":"getEntries.cjs","names":[],"sources":["../../src/getEntries.ts"],"sourcesContent":["import { listDictionaries } from '@intlayer/engine/listDictionaries';\nimport { getPathHash } from '@intlayer/engine/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { EntryObject } from 'webpack';\n\nexport const getEntries = async (\n configuration: IntlayerConfig\n): Promise<EntryObject> => {\n const files = await listDictionaries(configuration);\n\n return files.reduce((obj, el) => {\n const hash = getPathHash(el);\n\n obj[`intlayer-content/${hash}`] = {\n import: el,\n dependOn: undefined,\n };\n\n return obj;\n }, {} as EntryObject);\n};\n"],"mappings":";;;;;AAKA,MAAa,aAAa,OACxB,kBACyB;CAGzB,QAAO,8DAF8B,aAAa,EAEtC,CAAC,QAAQ,KAAK,OAAO;EAC/B,MAAM,+CAAmB,EAAE;EAE3B,IAAI,oBAAoB,UAAU;GAChC,QAAQ;GACR,UAAU;EACZ;EAEA,OAAO;CACT,GAAG,CAAC,CAAgB;AACtB"}
@@ -4,4 +4,4 @@ const require_webpack_config = require('./webpack.config.cjs');
4
4
 
5
5
  exports.IntlayerPlugin = require_webpack_plugin.IntlayerPlugin;
6
6
  exports.devServerConfig = require_webpack_config.devServerConfig;
7
- exports.getWebpackConfig = require_webpack_config;
7
+ exports.getWebpackConfig = require_webpack_config.default;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","names":["isESModule","path"],"sources":["../../src/utils.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\nexport const defineDirname = () => {\n const filename = isESModule\n ? fileURLToPath(import.meta.url)\n : require('node:url').pathToFileURL(__filename).toString();\n\n globalThis.__filename = globalThis.__filename ?? filename;\n globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);\n};\n"],"mappings":";;;;;;;;;;;AAOA,MAAa,sBAAsB;CACjC,MAAM,WAAWA,8GACiB,GAC9B,QAAQ,WAAW,CAAC,cAAc,WAAW,CAAC,UAAU;AAE5D,YAAW,aAAa,WAAW,cAAc;AACjD,YAAW,YAAY,WAAW,aAAaC,kBAAK,QAAQ,WAAW"}
1
+ {"version":3,"file":"utils.cjs","names":["isESModule","path"],"sources":["../../src/utils.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\nexport const defineDirname = () => {\n const filename = isESModule\n ? fileURLToPath(import.meta.url)\n : require('node:url').pathToFileURL(__filename).toString();\n\n globalThis.__filename = globalThis.__filename ?? filename;\n globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);\n};\n"],"mappings":";;;;;;;;;;;AAOA,MAAa,sBAAsB;CACjC,MAAM,WAAWA,6GACgB,IAC7B,QAAQ,UAAU,CAAC,CAAC,cAAc,UAAU,CAAC,CAAC,SAAS;CAE3D,WAAW,aAAa,WAAW,cAAc;CACjD,WAAW,YAAY,WAAW,aAAaC,kBAAK,QAAQ,UAAU;AACxE"}
@@ -1,13 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
2
  let _intlayer_config_utils = require("@intlayer/config/utils");
4
3
  let _intlayer_config_node = require("@intlayer/config/node");
5
- let _intlayer_chokidar_build = require("@intlayer/chokidar/build");
6
- let _intlayer_chokidar_watcher = require("@intlayer/chokidar/watcher");
7
4
  let _intlayer_config_colors = require("@intlayer/config/colors");
8
5
  let _intlayer_config_envVars = require("@intlayer/config/envVars");
9
6
  let _intlayer_config_logger = require("@intlayer/config/logger");
10
7
  let _intlayer_dictionaries_entry = require("@intlayer/dictionaries-entry");
8
+ let _intlayer_engine_build = require("@intlayer/engine/build");
9
+ let _intlayer_engine_watcher = require("@intlayer/engine/watcher");
11
10
 
12
11
  //#region src/webpack-plugin.ts
13
12
  var IntlayerPlugin = class {
@@ -20,6 +19,14 @@ var IntlayerPlugin = class {
20
19
  const { webpack } = compiler;
21
20
  const isBuild = compiler.options.mode !== "development";
22
21
  const appLogger = (0, _intlayer_config_logger.getAppLogger)(this.configuration);
22
+ compiler.hooks.beforeCompile.tapPromise("IntlayerPlugin", async () => {
23
+ if (!this.isWatching) try {
24
+ await (0, _intlayer_engine_build.prepareIntlayer)(this.configuration);
25
+ this.isWatching = true;
26
+ } catch (error) {
27
+ appLogger(`Error in IntlayerPlugin: ${error}`, { level: "error" });
28
+ }
29
+ });
23
30
  const wrapKey = (key) => `process.env.${key}`;
24
31
  const wrapValue = (value) => `"${value}"`;
25
32
  let env = { ...(0, _intlayer_config_envVars.getConfigEnvVars)(this.configuration, wrapKey, wrapValue) };
@@ -38,15 +45,7 @@ var IntlayerPlugin = class {
38
45
  "process.env": "({})",
39
46
  ...env
40
47
  }).apply(compiler);
41
- if (this.configuration.content.watch) await (0, _intlayer_chokidar_watcher.watch)({ configuration: this.configuration });
42
- compiler.hooks.beforeCompile.tapPromise("IntlayerPlugin", async () => {
43
- if (!this.isWatching) try {
44
- await (0, _intlayer_chokidar_build.prepareIntlayer)(this.configuration);
45
- this.isWatching = true;
46
- } catch (error) {
47
- appLogger(`Error in IntlayerPlugin: ${error}`, { level: "error" });
48
- }
49
- });
48
+ if (!isBuild && this.configuration.content.watch) await (0, _intlayer_engine_watcher.watch)({ configuration: this.configuration });
50
49
  }
51
50
  };
52
51
 
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-plugin.cjs","names":["BLUE"],"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { BLUE } from '@intlayer/config/colors';\nimport {\n formatDictionarySelectorEnvVar,\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n getHasDictionarySelector,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { IntlayerConfig } from '@intlayer/types/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;\n\n constructor(configuration?: IntlayerConfig) {\n this.configuration = configuration ?? getConfiguration();\n }\n\n async apply(compiler: Compiler): Promise<void> {\n const { webpack } = compiler;\n\n const isBuild = compiler.options.mode !== 'development';\n\n const appLogger = getAppLogger(this.configuration);\n\n const wrapKey = (key: string) => `process.env.${key}`;\n const wrapValue = (value: string) => `\"${value}\"`;\n\n // Specific `process.env.<KEY>` defines. webpack's DefinePlugin replaces both\n // the dot- and bracket-notation reads of a defined key, and — crucially —\n // folds them at *parse* time, which lets it dead-code-eliminate the guarded\n // dynamic `import()` chunks (e.g. the HTML/markdown renderers) for unused\n // node types. The config flags are emitted in every mode so routing/editor\n // behaviour is correct in dev too; the dictionary scan (used to prune node\n // types) only runs for production builds.\n let env: Record<string, string> = {\n ...getConfigEnvVars(this.configuration, wrapKey, wrapValue),\n };\n\n if (isBuild) {\n const dictionaries = getDictionaries(this.configuration);\n\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n\n if (unusedNodeTypes && unusedNodeTypes.length > 0) {\n appLogger(\n [\n 'Filtering out plugins:',\n unusedNodeTypes.map((key) => colorize(key, BLUE)).join(', '),\n ],\n {\n isVerbose: true,\n }\n );\n }\n\n env = {\n ...env,\n\n // Tree shaking based on unused node types\n ...formatNodeTypeToEnvVar(unusedNodeTypes, wrapKey, wrapValue),\n\n // Tree shaking the dictionary selector logic\n // (collections / variants)\n ...formatDictionarySelectorEnvVar(\n getHasDictionarySelector(dictionaries),\n wrapKey,\n wrapValue\n ),\n };\n }\n\n new webpack.DefinePlugin({\n // Catch-all so that any `process.env.*` read NOT folded by the specific\n // keys below still resolves to `undefined` instead of dereferencing a\n // bare `process`, which is not defined in browser bundles (e.g. Angular)\n // and throws `process is not defined`. This covers in-use node types\n // (never emitted as \"false\"), the dictionary selector when present, and\n // every read in development where the dictionary scan is skipped. Specific\n // keys (below) and host bundler defines (e.g. `process.env.NODE_ENV`) take\n // precedence over this object, so chunk-level tree shaking is preserved.\n 'process.env': '({})',\n ...env,\n }).apply(compiler);\n\n if (this.configuration.content.watch) {\n // Start watching (assuming watch is also async)\n await watch({ configuration: 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 appLogger(`Error in IntlayerPlugin: ${error}`, {\n level: 'error',\n });\n }\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAa,iBAAb,MAA4B;CAC1B,AAAQ,aAAa;CACrB,AAAQ;CAER,YAAY,eAAgC;AAC1C,OAAK,gBAAgB,8DAAmC;;CAG1D,MAAM,MAAM,UAAmC;EAC7C,MAAM,EAAE,YAAY;EAEpB,MAAM,UAAU,SAAS,QAAQ,SAAS;EAE1C,MAAM,sDAAyB,KAAK,cAAc;EAElD,MAAM,WAAW,QAAgB,eAAe;EAChD,MAAM,aAAa,UAAkB,IAAI,MAAM;EAS/C,IAAI,MAA8B,EAChC,kDAAoB,KAAK,eAAe,SAAS,UAAU,EAC5D;AAED,MAAI,SAAS;GACX,MAAM,iEAA+B,KAAK,cAAc;AAExD,OAAI,OAAO,KAAK,aAAa,CAAC,WAAW,EACvC,WAAU,2DAA2D,EACnE,WAAW,MACZ,CAAC;GAGJ,MAAM,kBAAkB,0DAA8B,aAAa;AAEnE,OAAI,mBAAmB,gBAAgB,SAAS,EAC9C,WACE,CACE,0BACA,gBAAgB,KAAK,8CAAiB,KAAKA,6BAAK,CAAC,CAAC,KAAK,KAAK,CAC7D,EACD,EACE,WAAW,MACZ,CACF;AAGH,SAAM;IACJ,GAAG;IAGH,wDAA0B,iBAAiB,SAAS,UAAU;IAI9D,qHAC2B,aAAa,EACtC,SACA,UACD;IACF;;AAGH,MAAI,QAAQ,aAAa;GASvB,eAAe;GACf,GAAG;GACJ,CAAC,CAAC,MAAM,SAAS;AAElB,MAAI,KAAK,cAAc,QAAQ,MAE7B,6CAAY,EAAE,eAAe,KAAK,eAAe,CAAC;AAGpD,WAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;AACpE,OAAI,CAAC,KAAK,WACR,KAAI;AACF,wDAAsB,KAAK,cAAc;AACzC,SAAK,aAAa;YACX,OAAO;AACd,cAAU,4BAA4B,SAAS,EAC7C,OAAO,SACR,CAAC;;IAGN"}
1
+ {"version":3,"file":"webpack-plugin.cjs","names":["BLUE"],"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { BLUE } from '@intlayer/config/colors';\nimport {\n formatDictionarySelectorEnvVar,\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n getHasDictionarySelector,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport { prepareIntlayer } from '@intlayer/engine/build';\nimport { watch } from '@intlayer/engine/watcher';\nimport type { IntlayerConfig } from '@intlayer/types/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;\n\n constructor(configuration?: IntlayerConfig) {\n this.configuration = configuration ?? getConfiguration();\n }\n\n async apply(compiler: Compiler): Promise<void> {\n const { webpack } = compiler;\n\n const isBuild = compiler.options.mode !== 'development';\n\n const appLogger = getAppLogger(this.configuration);\n\n // Register the dictionary preparation tap *synchronously*, before any\n // `await` below. webpack does not await a plugin's async `apply`, so any\n // hook tapped after an `await` (e.g. after `watch()`) may register too late\n // — after `beforeCompile` has already fired — leaving the `.intlayer`\n // dictionaries entry unbuilt when module resolution starts and breaking the\n // build with `Can't resolve '@intlayer/dictionaries-entry'`. Tapping here\n // guarantees the entry is prepared before compilation begins.\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 appLogger(`Error in IntlayerPlugin: ${error}`, {\n level: 'error',\n });\n }\n }\n });\n\n const wrapKey = (key: string) => `process.env.${key}`;\n const wrapValue = (value: string) => `\"${value}\"`;\n\n // Specific `process.env.<KEY>` defines. webpack's DefinePlugin replaces both\n // the dot- and bracket-notation reads of a defined key, and — crucially —\n // folds them at *parse* time, which lets it dead-code-eliminate the guarded\n // dynamic `import()` chunks (e.g. the HTML/markdown renderers) for unused\n // node types. The config flags are emitted in every mode so routing/editor\n // behaviour is correct in dev too; the dictionary scan (used to prune node\n // types) only runs for production builds.\n let env: Record<string, string> = {\n ...getConfigEnvVars(this.configuration, wrapKey, wrapValue),\n };\n\n if (isBuild) {\n const dictionaries = getDictionaries(this.configuration);\n\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n\n if (unusedNodeTypes && unusedNodeTypes.length > 0) {\n appLogger(\n [\n 'Filtering out plugins:',\n unusedNodeTypes.map((key) => colorize(key, BLUE)).join(', '),\n ],\n {\n isVerbose: true,\n }\n );\n }\n\n env = {\n ...env,\n\n // Tree shaking based on unused node types\n ...formatNodeTypeToEnvVar(unusedNodeTypes, wrapKey, wrapValue),\n\n // Tree shaking the dictionary selector logic\n // (collections / variants)\n ...formatDictionarySelectorEnvVar(\n getHasDictionarySelector(dictionaries),\n wrapKey,\n wrapValue\n ),\n };\n }\n\n new webpack.DefinePlugin({\n // Catch-all so that any `process.env.*` read NOT folded by the specific\n // keys below still resolves to `undefined` instead of dereferencing a\n // bare `process`, which is not defined in browser bundles (e.g. Angular)\n // and throws `process is not defined`. This covers in-use node types\n // (never emitted as \"false\"), the dictionary selector when present, and\n // every read in development where the dictionary scan is skipped. Specific\n // keys (below) and host bundler defines (e.g. `process.env.NODE_ENV`) take\n // precedence over this object, so chunk-level tree shaking is preserved.\n 'process.env': '({})',\n ...env,\n }).apply(compiler);\n\n // Only watch content declarations for the dev server. A production build is\n // a one-off compilation: starting a file watcher there serves no purpose and\n // keeps a live `fsevents`/chokidar stream open for the whole build.\n if (!isBuild && this.configuration.content.watch) {\n // Start watching (assuming watch is also async)\n await watch({ configuration: this.configuration });\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,iBAAb,MAA4B;CAC1B,AAAQ,aAAa;CACrB,AAAQ;CAER,YAAY,eAAgC;EAC1C,KAAK,gBAAgB,6DAAkC;CACzD;CAEA,MAAM,MAAM,UAAmC;EAC7C,MAAM,EAAE,YAAY;EAEpB,MAAM,UAAU,SAAS,QAAQ,SAAS;EAE1C,MAAM,sDAAyB,KAAK,aAAa;EASjD,SAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;GACpE,IAAI,CAAC,KAAK,YACR,IAAI;IACF,kDAAsB,KAAK,aAAa;IACxC,KAAK,aAAa;GACpB,SAAS,OAAO;IACd,UAAU,4BAA4B,SAAS,EAC7C,OAAO,QACT,CAAC;GACH;EAEJ,CAAC;EAED,MAAM,WAAW,QAAgB,eAAe;EAChD,MAAM,aAAa,UAAkB,IAAI,MAAM;EAS/C,IAAI,MAA8B,EAChC,kDAAoB,KAAK,eAAe,SAAS,SAAS,EAC5D;EAEA,IAAI,SAAS;GACX,MAAM,iEAA+B,KAAK,aAAa;GAEvD,IAAI,OAAO,KAAK,YAAY,CAAC,CAAC,WAAW,GACvC,UAAU,2DAA2D,EACnE,WAAW,KACb,CAAC;GAGH,MAAM,kBAAkB,0DAA8B,YAAY;GAElE,IAAI,mBAAmB,gBAAgB,SAAS,GAC9C,UACE,CACE,0BACA,gBAAgB,KAAK,8CAAiB,KAAKA,4BAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAC7D,GACA,EACE,WAAW,KACb,CACF;GAGF,MAAM;IACJ,GAAG;IAGH,wDAA0B,iBAAiB,SAAS,SAAS;IAI7D,qHAC2B,YAAY,GACrC,SACA,SACF;GACF;EACF;EAEA,IAAI,QAAQ,aAAa;GASvB,eAAe;GACf,GAAG;EACL,CAAC,CAAC,CAAC,MAAM,QAAQ;EAKjB,IAAI,CAAC,WAAW,KAAK,cAAc,QAAQ,OAEzC,0CAAY,EAAE,eAAe,KAAK,cAAc,CAAC;CAErD;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
2
  const require_getEntries = require('./getEntries.cjs');
4
3
  const require_utils = require('./utils.cjs');
5
4
  const require_webpack_plugin = require('./webpack-plugin.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.config.cjs","names":["getEntries","IntlayerPlugin"],"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n// @ts-ignore - Export exists\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntlayerPlugin } from './webpack-plugin';\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', // derived from content.fileExtensions + content.contentDir\n\n devMiddleware: {\n // Enable write to disk to reuse the output\n writeToDisk: true,\n },\n\n // Content base\n static: {},\n};\n\nexport const getWebpackConfig = (\n configuration: IntlayerConfig = getConfiguration()\n): WebPackConfiguration => {\n const { fileExtensions } = configuration.content;\n\n /**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\n defineDirname();\n\n const webpackConfig: WebPackConfiguration = {\n // Define the environment mode (development or production)\n mode: 'production', // or 'production'\n // Entry point of the application\n target: 'node', // Specifies the target environment\n\n entry: () => getEntries(configuration),\n output: {\n clean: true, // Clean the output directory before emit\n library: 'IntlLayerContent',\n libraryTarget: 'umd',\n filename: `[name].bundle.js`,\n },\n\n cache: false,\n\n devtool: 'source-map',\n\n // stats: {\n // preset: 'errors-only',\n // warnings: false,\n // },\n ignoreWarnings: [/./],\n resolve: {\n // Resolve TypeScript, JavaScript and JSON files\n extensions: [\n '.ts',\n '.js',\n '.json',\n '.wasm',\n '.ts',\n '.tsx',\n '.mjs',\n '.cjs',\n ],\n modules: [\n // To find the loader module\n join(globalThis.__dirname, '..', 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules', 'intlayer-cli', 'node_modules'), // Or via another project by importing intlayer\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n resolveLoader: {\n // Configure how Webpack finds `loader` modules.\n modules: [\n // To find the loader module\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(\n process.cwd(),\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing @intlayer/webpack\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n module: {\n rules: [\n {\n // Rule for .content.ts files\n test: new RegExp(`(${fileExtensions.join('|')})$`),\n use: [\n {\n // Transpile with esbuild-loader\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n // {\n // // Custom loader to process the transpiled code\n // loader: resolve('./intlayer-loader'),\n // },\n ],\n },\n {\n test: /\\.node$/,\n loader: 'node-loader',\n },\n // Use esbuild to compile JavaScript & TypeScript\n {\n // Match `.js`, `.jsx`, `.ts` or `.tsx` files\n test: /\\.(jsx|js|ts|tsx|mjs|cjs)?$/,\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n\n // JSON files are supported natively by Webpack 5, no specific loader required\n ],\n },\n devServer: devServerConfig,\n\n plugins: [new IntlayerPlugin(configuration)],\n };\n\n return webpackConfig;\n};\n\nexport default getWebpackConfig;\n"],"mappings":";;;;;;;;;AAWA,MAAa,kBAA0C;CAErD,KAAK;CAEL,MAAM;CACN,YAAY;CAGZ,UAAU;CAGV,oBAAoB;CAGpB,MAAM;CACN,MAAM;CAEN,YAAY;CAEZ,eAAe,EAEb,aAAa,MACd;CAGD,QAAQ,EAAE;CACX;AAED,MAAa,oBACX,6DAAkD,KACzB;CACzB,MAAM,EAAE,mBAAmB,cAAc;;;;AAKzC,8BAAe;AAsHf,QAAO;EAlHL,MAAM;EAEN,QAAQ;EAER,aAAaA,8BAAW,cAAc;EACtC,QAAQ;GACN,OAAO;GACP,SAAS;GACT,eAAe;GACf,UAAU;GACX;EAED,OAAO;EAEP,SAAS;EAMT,gBAAgB,CAAC,IAAI;EACrB,SAAS;GAEP,YAAY;IACV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD;GACD,SAAS;wBAEF,WAAW,WAAW,MAAM,eAAe;wBAC3C,QAAQ,KAAK,EAAE,eAAe;wBAC9B,QAAQ,KAAK,EAAE,gBAAgB,gBAAgB,eAAe;wBAEjE,QAAQ,KAAK,EACb,gBACA,gBACA,gBACA,qBACA,eACD;IACF;GACF;EAED,eAAe,EAEb,SAAS;uBAEF,QAAQ,KAAK,EAAE,eAAe;uBAEjC,QAAQ,KAAK,EACb,gBACA,qBACA,eACD;uBAEC,QAAQ,KAAK,EACb,gBACA,gBACA,gBACA,qBACA,eACD;GACF,EACF;EAED,QAAQ,EACN,OAAO;GACL;IAEE,MAAM,IAAI,OAAO,IAAI,eAAe,KAAK,IAAI,CAAC,IAAI;IAClD,KAAK,CACH;KAEE,QAAQ;KACR,SAAS,EAEP,QAAQ,UACT;KACF,CAKF;IACF;GACD;IACE,MAAM;IACN,QAAQ;IACT;GAED;IAEE,MAAM;IACN,QAAQ;IACR,SAAS,EAEP,QAAQ,UACT;IACF;GAGF,EACF;EACD,WAAW;EAEX,SAAS,CAAC,IAAIC,sCAAe,cAAc,CAAC;EAG1B"}
1
+ {"version":3,"file":"webpack.config.cjs","names":["getEntries","IntlayerPlugin"],"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n// @ts-ignore - Export exists\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntlayerPlugin } from './webpack-plugin';\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', // derived from content.fileExtensions + content.contentDir\n\n devMiddleware: {\n // Enable write to disk to reuse the output\n writeToDisk: true,\n },\n\n // Content base\n static: {},\n};\n\nexport const getWebpackConfig = (\n configuration: IntlayerConfig = getConfiguration()\n): WebPackConfiguration => {\n const { fileExtensions } = configuration.content;\n\n /**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\n defineDirname();\n\n const webpackConfig: WebPackConfiguration = {\n // Define the environment mode (development or production)\n mode: 'production', // or 'production'\n // Entry point of the application\n target: 'node', // Specifies the target environment\n\n entry: () => getEntries(configuration),\n output: {\n clean: true, // Clean the output directory before emit\n library: 'IntlLayerContent',\n libraryTarget: 'umd',\n filename: `[name].bundle.js`,\n },\n\n cache: false,\n\n devtool: 'source-map',\n\n // stats: {\n // preset: 'errors-only',\n // warnings: false,\n // },\n ignoreWarnings: [/./],\n resolve: {\n // Resolve TypeScript, JavaScript and JSON files\n extensions: [\n '.ts',\n '.js',\n '.json',\n '.wasm',\n '.ts',\n '.tsx',\n '.mjs',\n '.cjs',\n ],\n modules: [\n // To find the loader module\n join(globalThis.__dirname, '..', 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules', 'intlayer-cli', 'node_modules'), // Or via another project by importing intlayer\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n resolveLoader: {\n // Configure how Webpack finds `loader` modules.\n modules: [\n // To find the loader module\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(\n process.cwd(),\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing @intlayer/webpack\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n module: {\n rules: [\n {\n // Rule for .content.ts files\n test: new RegExp(`(${fileExtensions.join('|')})$`),\n use: [\n {\n // Transpile with esbuild-loader\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n // {\n // // Custom loader to process the transpiled code\n // loader: resolve('./intlayer-loader'),\n // },\n ],\n },\n {\n test: /\\.node$/,\n loader: 'node-loader',\n },\n // Use esbuild to compile JavaScript & TypeScript\n {\n // Match `.js`, `.jsx`, `.ts` or `.tsx` files\n test: /\\.(jsx|js|ts|tsx|mjs|cjs)?$/,\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n\n // JSON files are supported natively by Webpack 5, no specific loader required\n ],\n },\n devServer: devServerConfig,\n\n plugins: [new IntlayerPlugin(configuration)],\n };\n\n return webpackConfig;\n};\n\nexport default getWebpackConfig;\n"],"mappings":";;;;;;;;AAWA,MAAa,kBAA0C;CAErD,KAAK;CAEL,MAAM;CACN,YAAY;CAGZ,UAAU;CAGV,oBAAoB;CAGpB,MAAM;CACN,MAAM;CAEN,YAAY;CAEZ,eAAe,EAEb,aAAa,KACf;CAGA,QAAQ,CAAC;AACX;AAEA,MAAa,oBACX,4DAAiD,MACxB;CACzB,MAAM,EAAE,mBAAmB,cAAc;;;;CAKzC,4BAAc;CAsHd,OAAO;EAlHL,MAAM;EAEN,QAAQ;EAER,aAAaA,8BAAW,aAAa;EACrC,QAAQ;GACN,OAAO;GACP,SAAS;GACT,eAAe;GACf,UAAU;EACZ;EAEA,OAAO;EAEP,SAAS;EAMT,gBAAgB,CAAC,GAAG;EACpB,SAAS;GAEP,YAAY;IACV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,SAAS;wBAEF,WAAW,WAAW,MAAM,cAAc;wBAC1C,QAAQ,IAAI,GAAG,cAAc;wBAC7B,QAAQ,IAAI,GAAG,gBAAgB,gBAAgB,cAAc;wBAEhE,QAAQ,IAAI,GACZ,gBACA,gBACA,gBACA,qBACA,cACF;GACF;EACF;EAEA,eAAe,EAEb,SAAS;uBAEF,QAAQ,IAAI,GAAG,cAAc;uBAEhC,QAAQ,IAAI,GACZ,gBACA,qBACA,cACF;uBAEE,QAAQ,IAAI,GACZ,gBACA,gBACA,gBACA,qBACA,cACF;EACF,EACF;EAEA,QAAQ,EACN,OAAO;GACL;IAEE,MAAM,IAAI,OAAO,IAAI,eAAe,KAAK,GAAG,EAAE,GAAG;IACjD,KAAK,CACH;KAEE,QAAQ;KACR,SAAS,EAEP,QAAQ,SACV;IACF,CAKF;GACF;GACA;IACE,MAAM;IACN,QAAQ;GACV;GAEA;IAEE,MAAM;IACN,QAAQ;IACR,SAAS,EAEP,QAAQ,SACV;GACF;EAGF,EACF;EACA,WAAW;EAEX,SAAS,CAAC,IAAIC,sCAAe,aAAa,CAAC;CAG1B;AACrB"}
@@ -1,5 +1,5 @@
1
- import { listDictionaries } from "@intlayer/chokidar/listDictionaries";
2
- import { getPathHash } from "@intlayer/chokidar/utils";
1
+ import { listDictionaries } from "@intlayer/engine/listDictionaries";
2
+ import { getPathHash } from "@intlayer/engine/utils";
3
3
 
4
4
  //#region src/getEntries.ts
5
5
  const getEntries = async (configuration) => {
@@ -1 +1 @@
1
- {"version":3,"file":"getEntries.mjs","names":[],"sources":["../../src/getEntries.ts"],"sourcesContent":["import { listDictionaries } from '@intlayer/chokidar/listDictionaries';\nimport { getPathHash } from '@intlayer/chokidar/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { EntryObject } from 'webpack';\n\nexport const getEntries = async (\n configuration: IntlayerConfig\n): Promise<EntryObject> => {\n const files = await listDictionaries(configuration);\n\n return files.reduce((obj, el) => {\n const hash = getPathHash(el);\n\n obj[`intlayer-content/${hash}`] = {\n import: el,\n dependOn: undefined,\n };\n\n return obj;\n }, {} as EntryObject);\n};\n"],"mappings":";;;;AAKA,MAAa,aAAa,OACxB,kBACyB;AAGzB,SAAO,MAFa,iBAAiB,cAAc,EAEtC,QAAQ,KAAK,OAAO;EAC/B,MAAM,OAAO,YAAY,GAAG;AAE5B,MAAI,oBAAoB,UAAU;GAChC,QAAQ;GACR,UAAU;GACX;AAED,SAAO;IACN,EAAE,CAAgB"}
1
+ {"version":3,"file":"getEntries.mjs","names":[],"sources":["../../src/getEntries.ts"],"sourcesContent":["import { listDictionaries } from '@intlayer/engine/listDictionaries';\nimport { getPathHash } from '@intlayer/engine/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { EntryObject } from 'webpack';\n\nexport const getEntries = async (\n configuration: IntlayerConfig\n): Promise<EntryObject> => {\n const files = await listDictionaries(configuration);\n\n return files.reduce((obj, el) => {\n const hash = getPathHash(el);\n\n obj[`intlayer-content/${hash}`] = {\n import: el,\n dependOn: undefined,\n };\n\n return obj;\n }, {} as EntryObject);\n};\n"],"mappings":";;;;AAKA,MAAa,aAAa,OACxB,kBACyB;CAGzB,QAAO,MAFa,iBAAiB,aAAa,EAEtC,CAAC,QAAQ,KAAK,OAAO;EAC/B,MAAM,OAAO,YAAY,EAAE;EAE3B,IAAI,oBAAoB,UAAU;GAChC,QAAQ;GACR,UAAU;EACZ;EAEA,OAAO;CACT,GAAG,CAAC,CAAgB;AACtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\nexport const defineDirname = () => {\n const filename = isESModule\n ? fileURLToPath(import.meta.url)\n : require('node:url').pathToFileURL(__filename).toString();\n\n globalThis.__filename = globalThis.__filename ?? filename;\n globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);\n};\n"],"mappings":";;;;;;;;;AAOA,MAAa,sBAAsB;CACjC,MAAM,WAAW,aACb,cAAc,OAAO,KAAK,IAAI,aACtB,WAAW,CAAC,cAAc,WAAW,CAAC,UAAU;AAE5D,YAAW,aAAa,WAAW,cAAc;AACjD,YAAW,YAAY,WAAW,aAAa,KAAK,QAAQ,WAAW"}
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\nexport const defineDirname = () => {\n const filename = isESModule\n ? fileURLToPath(import.meta.url)\n : require('node:url').pathToFileURL(__filename).toString();\n\n globalThis.__filename = globalThis.__filename ?? filename;\n globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);\n};\n"],"mappings":";;;;;;;;;AAOA,MAAa,sBAAsB;CACjC,MAAM,WAAW,aACb,cAAc,OAAO,KAAK,GAAG,cACrB,UAAU,CAAC,CAAC,cAAc,UAAU,CAAC,CAAC,SAAS;CAE3D,WAAW,aAAa,WAAW,cAAc;CACjD,WAAW,YAAY,WAAW,aAAa,KAAK,QAAQ,UAAU;AACxE"}
@@ -1,11 +1,11 @@
1
1
  import { getHasDictionarySelector, getUnusedNodeTypesAsync } from "@intlayer/config/utils";
2
2
  import { getConfiguration } from "@intlayer/config/node";
3
- import { prepareIntlayer } from "@intlayer/chokidar/build";
4
- import { watch } from "@intlayer/chokidar/watcher";
5
3
  import { BLUE } from "@intlayer/config/colors";
6
4
  import { formatDictionarySelectorEnvVar, formatNodeTypeToEnvVar, getConfigEnvVars } from "@intlayer/config/envVars";
7
5
  import { colorize, getAppLogger } from "@intlayer/config/logger";
8
6
  import { getDictionaries } from "@intlayer/dictionaries-entry";
7
+ import { prepareIntlayer } from "@intlayer/engine/build";
8
+ import { watch } from "@intlayer/engine/watcher";
9
9
 
10
10
  //#region src/webpack-plugin.ts
11
11
  var IntlayerPlugin = class {
@@ -18,6 +18,14 @@ var IntlayerPlugin = class {
18
18
  const { webpack } = compiler;
19
19
  const isBuild = compiler.options.mode !== "development";
20
20
  const appLogger = getAppLogger(this.configuration);
21
+ compiler.hooks.beforeCompile.tapPromise("IntlayerPlugin", async () => {
22
+ if (!this.isWatching) try {
23
+ await prepareIntlayer(this.configuration);
24
+ this.isWatching = true;
25
+ } catch (error) {
26
+ appLogger(`Error in IntlayerPlugin: ${error}`, { level: "error" });
27
+ }
28
+ });
21
29
  const wrapKey = (key) => `process.env.${key}`;
22
30
  const wrapValue = (value) => `"${value}"`;
23
31
  let env = { ...getConfigEnvVars(this.configuration, wrapKey, wrapValue) };
@@ -36,15 +44,7 @@ var IntlayerPlugin = class {
36
44
  "process.env": "({})",
37
45
  ...env
38
46
  }).apply(compiler);
39
- if (this.configuration.content.watch) await watch({ configuration: this.configuration });
40
- compiler.hooks.beforeCompile.tapPromise("IntlayerPlugin", async () => {
41
- if (!this.isWatching) try {
42
- await prepareIntlayer(this.configuration);
43
- this.isWatching = true;
44
- } catch (error) {
45
- appLogger(`Error in IntlayerPlugin: ${error}`, { level: "error" });
46
- }
47
- });
47
+ if (!isBuild && this.configuration.content.watch) await watch({ configuration: this.configuration });
48
48
  }
49
49
  };
50
50
 
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-plugin.mjs","names":[],"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { BLUE } from '@intlayer/config/colors';\nimport {\n formatDictionarySelectorEnvVar,\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n getHasDictionarySelector,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { IntlayerConfig } from '@intlayer/types/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;\n\n constructor(configuration?: IntlayerConfig) {\n this.configuration = configuration ?? getConfiguration();\n }\n\n async apply(compiler: Compiler): Promise<void> {\n const { webpack } = compiler;\n\n const isBuild = compiler.options.mode !== 'development';\n\n const appLogger = getAppLogger(this.configuration);\n\n const wrapKey = (key: string) => `process.env.${key}`;\n const wrapValue = (value: string) => `\"${value}\"`;\n\n // Specific `process.env.<KEY>` defines. webpack's DefinePlugin replaces both\n // the dot- and bracket-notation reads of a defined key, and — crucially —\n // folds them at *parse* time, which lets it dead-code-eliminate the guarded\n // dynamic `import()` chunks (e.g. the HTML/markdown renderers) for unused\n // node types. The config flags are emitted in every mode so routing/editor\n // behaviour is correct in dev too; the dictionary scan (used to prune node\n // types) only runs for production builds.\n let env: Record<string, string> = {\n ...getConfigEnvVars(this.configuration, wrapKey, wrapValue),\n };\n\n if (isBuild) {\n const dictionaries = getDictionaries(this.configuration);\n\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n\n if (unusedNodeTypes && unusedNodeTypes.length > 0) {\n appLogger(\n [\n 'Filtering out plugins:',\n unusedNodeTypes.map((key) => colorize(key, BLUE)).join(', '),\n ],\n {\n isVerbose: true,\n }\n );\n }\n\n env = {\n ...env,\n\n // Tree shaking based on unused node types\n ...formatNodeTypeToEnvVar(unusedNodeTypes, wrapKey, wrapValue),\n\n // Tree shaking the dictionary selector logic\n // (collections / variants)\n ...formatDictionarySelectorEnvVar(\n getHasDictionarySelector(dictionaries),\n wrapKey,\n wrapValue\n ),\n };\n }\n\n new webpack.DefinePlugin({\n // Catch-all so that any `process.env.*` read NOT folded by the specific\n // keys below still resolves to `undefined` instead of dereferencing a\n // bare `process`, which is not defined in browser bundles (e.g. Angular)\n // and throws `process is not defined`. This covers in-use node types\n // (never emitted as \"false\"), the dictionary selector when present, and\n // every read in development where the dictionary scan is skipped. Specific\n // keys (below) and host bundler defines (e.g. `process.env.NODE_ENV`) take\n // precedence over this object, so chunk-level tree shaking is preserved.\n 'process.env': '({})',\n ...env,\n }).apply(compiler);\n\n if (this.configuration.content.watch) {\n // Start watching (assuming watch is also async)\n await watch({ configuration: 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 appLogger(`Error in IntlayerPlugin: ${error}`, {\n level: 'error',\n });\n }\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;AAmBA,IAAa,iBAAb,MAA4B;CAC1B,AAAQ,aAAa;CACrB,AAAQ;CAER,YAAY,eAAgC;AAC1C,OAAK,gBAAgB,iBAAiB,kBAAkB;;CAG1D,MAAM,MAAM,UAAmC;EAC7C,MAAM,EAAE,YAAY;EAEpB,MAAM,UAAU,SAAS,QAAQ,SAAS;EAE1C,MAAM,YAAY,aAAa,KAAK,cAAc;EAElD,MAAM,WAAW,QAAgB,eAAe;EAChD,MAAM,aAAa,UAAkB,IAAI,MAAM;EAS/C,IAAI,MAA8B,EAChC,GAAG,iBAAiB,KAAK,eAAe,SAAS,UAAU,EAC5D;AAED,MAAI,SAAS;GACX,MAAM,eAAe,gBAAgB,KAAK,cAAc;AAExD,OAAI,OAAO,KAAK,aAAa,CAAC,WAAW,EACvC,WAAU,2DAA2D,EACnE,WAAW,MACZ,CAAC;GAGJ,MAAM,kBAAkB,MAAM,wBAAwB,aAAa;AAEnE,OAAI,mBAAmB,gBAAgB,SAAS,EAC9C,WACE,CACE,0BACA,gBAAgB,KAAK,QAAQ,SAAS,KAAK,KAAK,CAAC,CAAC,KAAK,KAAK,CAC7D,EACD,EACE,WAAW,MACZ,CACF;AAGH,SAAM;IACJ,GAAG;IAGH,GAAG,uBAAuB,iBAAiB,SAAS,UAAU;IAI9D,GAAG,+BACD,yBAAyB,aAAa,EACtC,SACA,UACD;IACF;;AAGH,MAAI,QAAQ,aAAa;GASvB,eAAe;GACf,GAAG;GACJ,CAAC,CAAC,MAAM,SAAS;AAElB,MAAI,KAAK,cAAc,QAAQ,MAE7B,OAAM,MAAM,EAAE,eAAe,KAAK,eAAe,CAAC;AAGpD,WAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;AACpE,OAAI,CAAC,KAAK,WACR,KAAI;AACF,UAAM,gBAAgB,KAAK,cAAc;AACzC,SAAK,aAAa;YACX,OAAO;AACd,cAAU,4BAA4B,SAAS,EAC7C,OAAO,SACR,CAAC;;IAGN"}
1
+ {"version":3,"file":"webpack-plugin.mjs","names":[],"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { BLUE } from '@intlayer/config/colors';\nimport {\n formatDictionarySelectorEnvVar,\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n getHasDictionarySelector,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport { prepareIntlayer } from '@intlayer/engine/build';\nimport { watch } from '@intlayer/engine/watcher';\nimport type { IntlayerConfig } from '@intlayer/types/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;\n\n constructor(configuration?: IntlayerConfig) {\n this.configuration = configuration ?? getConfiguration();\n }\n\n async apply(compiler: Compiler): Promise<void> {\n const { webpack } = compiler;\n\n const isBuild = compiler.options.mode !== 'development';\n\n const appLogger = getAppLogger(this.configuration);\n\n // Register the dictionary preparation tap *synchronously*, before any\n // `await` below. webpack does not await a plugin's async `apply`, so any\n // hook tapped after an `await` (e.g. after `watch()`) may register too late\n // — after `beforeCompile` has already fired — leaving the `.intlayer`\n // dictionaries entry unbuilt when module resolution starts and breaking the\n // build with `Can't resolve '@intlayer/dictionaries-entry'`. Tapping here\n // guarantees the entry is prepared before compilation begins.\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 appLogger(`Error in IntlayerPlugin: ${error}`, {\n level: 'error',\n });\n }\n }\n });\n\n const wrapKey = (key: string) => `process.env.${key}`;\n const wrapValue = (value: string) => `\"${value}\"`;\n\n // Specific `process.env.<KEY>` defines. webpack's DefinePlugin replaces both\n // the dot- and bracket-notation reads of a defined key, and — crucially —\n // folds them at *parse* time, which lets it dead-code-eliminate the guarded\n // dynamic `import()` chunks (e.g. the HTML/markdown renderers) for unused\n // node types. The config flags are emitted in every mode so routing/editor\n // behaviour is correct in dev too; the dictionary scan (used to prune node\n // types) only runs for production builds.\n let env: Record<string, string> = {\n ...getConfigEnvVars(this.configuration, wrapKey, wrapValue),\n };\n\n if (isBuild) {\n const dictionaries = getDictionaries(this.configuration);\n\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n\n if (unusedNodeTypes && unusedNodeTypes.length > 0) {\n appLogger(\n [\n 'Filtering out plugins:',\n unusedNodeTypes.map((key) => colorize(key, BLUE)).join(', '),\n ],\n {\n isVerbose: true,\n }\n );\n }\n\n env = {\n ...env,\n\n // Tree shaking based on unused node types\n ...formatNodeTypeToEnvVar(unusedNodeTypes, wrapKey, wrapValue),\n\n // Tree shaking the dictionary selector logic\n // (collections / variants)\n ...formatDictionarySelectorEnvVar(\n getHasDictionarySelector(dictionaries),\n wrapKey,\n wrapValue\n ),\n };\n }\n\n new webpack.DefinePlugin({\n // Catch-all so that any `process.env.*` read NOT folded by the specific\n // keys below still resolves to `undefined` instead of dereferencing a\n // bare `process`, which is not defined in browser bundles (e.g. Angular)\n // and throws `process is not defined`. This covers in-use node types\n // (never emitted as \"false\"), the dictionary selector when present, and\n // every read in development where the dictionary scan is skipped. Specific\n // keys (below) and host bundler defines (e.g. `process.env.NODE_ENV`) take\n // precedence over this object, so chunk-level tree shaking is preserved.\n 'process.env': '({})',\n ...env,\n }).apply(compiler);\n\n // Only watch content declarations for the dev server. A production build is\n // a one-off compilation: starting a file watcher there serves no purpose and\n // keeps a live `fsevents`/chokidar stream open for the whole build.\n if (!isBuild && this.configuration.content.watch) {\n // Start watching (assuming watch is also async)\n await watch({ configuration: this.configuration });\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAmBA,IAAa,iBAAb,MAA4B;CAC1B,AAAQ,aAAa;CACrB,AAAQ;CAER,YAAY,eAAgC;EAC1C,KAAK,gBAAgB,iBAAiB,iBAAiB;CACzD;CAEA,MAAM,MAAM,UAAmC;EAC7C,MAAM,EAAE,YAAY;EAEpB,MAAM,UAAU,SAAS,QAAQ,SAAS;EAE1C,MAAM,YAAY,aAAa,KAAK,aAAa;EASjD,SAAS,MAAM,cAAc,WAAW,kBAAkB,YAAY;GACpE,IAAI,CAAC,KAAK,YACR,IAAI;IACF,MAAM,gBAAgB,KAAK,aAAa;IACxC,KAAK,aAAa;GACpB,SAAS,OAAO;IACd,UAAU,4BAA4B,SAAS,EAC7C,OAAO,QACT,CAAC;GACH;EAEJ,CAAC;EAED,MAAM,WAAW,QAAgB,eAAe;EAChD,MAAM,aAAa,UAAkB,IAAI,MAAM;EAS/C,IAAI,MAA8B,EAChC,GAAG,iBAAiB,KAAK,eAAe,SAAS,SAAS,EAC5D;EAEA,IAAI,SAAS;GACX,MAAM,eAAe,gBAAgB,KAAK,aAAa;GAEvD,IAAI,OAAO,KAAK,YAAY,CAAC,CAAC,WAAW,GACvC,UAAU,2DAA2D,EACnE,WAAW,KACb,CAAC;GAGH,MAAM,kBAAkB,MAAM,wBAAwB,YAAY;GAElE,IAAI,mBAAmB,gBAAgB,SAAS,GAC9C,UACE,CACE,0BACA,gBAAgB,KAAK,QAAQ,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAC7D,GACA,EACE,WAAW,KACb,CACF;GAGF,MAAM;IACJ,GAAG;IAGH,GAAG,uBAAuB,iBAAiB,SAAS,SAAS;IAI7D,GAAG,+BACD,yBAAyB,YAAY,GACrC,SACA,SACF;GACF;EACF;EAEA,IAAI,QAAQ,aAAa;GASvB,eAAe;GACf,GAAG;EACL,CAAC,CAAC,CAAC,MAAM,QAAQ;EAKjB,IAAI,CAAC,WAAW,KAAK,cAAc,QAAQ,OAEzC,MAAM,MAAM,EAAE,eAAe,KAAK,cAAc,CAAC;CAErD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.config.mjs","names":[],"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n// @ts-ignore - Export exists\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntlayerPlugin } from './webpack-plugin';\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', // derived from content.fileExtensions + content.contentDir\n\n devMiddleware: {\n // Enable write to disk to reuse the output\n writeToDisk: true,\n },\n\n // Content base\n static: {},\n};\n\nexport const getWebpackConfig = (\n configuration: IntlayerConfig = getConfiguration()\n): WebPackConfiguration => {\n const { fileExtensions } = configuration.content;\n\n /**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\n defineDirname();\n\n const webpackConfig: WebPackConfiguration = {\n // Define the environment mode (development or production)\n mode: 'production', // or 'production'\n // Entry point of the application\n target: 'node', // Specifies the target environment\n\n entry: () => getEntries(configuration),\n output: {\n clean: true, // Clean the output directory before emit\n library: 'IntlLayerContent',\n libraryTarget: 'umd',\n filename: `[name].bundle.js`,\n },\n\n cache: false,\n\n devtool: 'source-map',\n\n // stats: {\n // preset: 'errors-only',\n // warnings: false,\n // },\n ignoreWarnings: [/./],\n resolve: {\n // Resolve TypeScript, JavaScript and JSON files\n extensions: [\n '.ts',\n '.js',\n '.json',\n '.wasm',\n '.ts',\n '.tsx',\n '.mjs',\n '.cjs',\n ],\n modules: [\n // To find the loader module\n join(globalThis.__dirname, '..', 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules', 'intlayer-cli', 'node_modules'), // Or via another project by importing intlayer\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n resolveLoader: {\n // Configure how Webpack finds `loader` modules.\n modules: [\n // To find the loader module\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(\n process.cwd(),\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing @intlayer/webpack\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n module: {\n rules: [\n {\n // Rule for .content.ts files\n test: new RegExp(`(${fileExtensions.join('|')})$`),\n use: [\n {\n // Transpile with esbuild-loader\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n // {\n // // Custom loader to process the transpiled code\n // loader: resolve('./intlayer-loader'),\n // },\n ],\n },\n {\n test: /\\.node$/,\n loader: 'node-loader',\n },\n // Use esbuild to compile JavaScript & TypeScript\n {\n // Match `.js`, `.jsx`, `.ts` or `.tsx` files\n test: /\\.(jsx|js|ts|tsx|mjs|cjs)?$/,\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n\n // JSON files are supported natively by Webpack 5, no specific loader required\n ],\n },\n devServer: devServerConfig,\n\n plugins: [new IntlayerPlugin(configuration)],\n };\n\n return webpackConfig;\n};\n\nexport default getWebpackConfig;\n"],"mappings":";;;;;;;AAWA,MAAa,kBAA0C;CAErD,KAAK;CAEL,MAAM;CACN,YAAY;CAGZ,UAAU;CAGV,oBAAoB;CAGpB,MAAM;CACN,MAAM;CAEN,YAAY;CAEZ,eAAe,EAEb,aAAa,MACd;CAGD,QAAQ,EAAE;CACX;AAED,MAAa,oBACX,gBAAgC,kBAAkB,KACzB;CACzB,MAAM,EAAE,mBAAmB,cAAc;;;;AAKzC,gBAAe;AAsHf,QAAO;EAlHL,MAAM;EAEN,QAAQ;EAER,aAAa,WAAW,cAAc;EACtC,QAAQ;GACN,OAAO;GACP,SAAS;GACT,eAAe;GACf,UAAU;GACX;EAED,OAAO;EAEP,SAAS;EAMT,gBAAgB,CAAC,IAAI;EACrB,SAAS;GAEP,YAAY;IACV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD;GACD,SAAS;IAEP,KAAK,WAAW,WAAW,MAAM,eAAe;IAChD,KAAK,QAAQ,KAAK,EAAE,eAAe;IACnC,KAAK,QAAQ,KAAK,EAAE,gBAAgB,gBAAgB,eAAe;IACnE,KACE,QAAQ,KAAK,EACb,gBACA,gBACA,gBACA,qBACA,eACD;IACF;GACF;EAED,eAAe,EAEb,SAAS;GAEP,KAAK,QAAQ,KAAK,EAAE,eAAe;GACnC,KACE,QAAQ,KAAK,EACb,gBACA,qBACA,eACD;GACD,KACE,QAAQ,KAAK,EACb,gBACA,gBACA,gBACA,qBACA,eACD;GACF,EACF;EAED,QAAQ,EACN,OAAO;GACL;IAEE,MAAM,IAAI,OAAO,IAAI,eAAe,KAAK,IAAI,CAAC,IAAI;IAClD,KAAK,CACH;KAEE,QAAQ;KACR,SAAS,EAEP,QAAQ,UACT;KACF,CAKF;IACF;GACD;IACE,MAAM;IACN,QAAQ;IACT;GAED;IAEE,MAAM;IACN,QAAQ;IACR,SAAS,EAEP,QAAQ,UACT;IACF;GAGF,EACF;EACD,WAAW;EAEX,SAAS,CAAC,IAAI,eAAe,cAAc,CAAC;EAG1B"}
1
+ {"version":3,"file":"webpack.config.mjs","names":[],"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n// @ts-ignore - Export exists\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntlayerPlugin } from './webpack-plugin';\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', // derived from content.fileExtensions + content.contentDir\n\n devMiddleware: {\n // Enable write to disk to reuse the output\n writeToDisk: true,\n },\n\n // Content base\n static: {},\n};\n\nexport const getWebpackConfig = (\n configuration: IntlayerConfig = getConfiguration()\n): WebPackConfiguration => {\n const { fileExtensions } = configuration.content;\n\n /**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\n defineDirname();\n\n const webpackConfig: WebPackConfiguration = {\n // Define the environment mode (development or production)\n mode: 'production', // or 'production'\n // Entry point of the application\n target: 'node', // Specifies the target environment\n\n entry: () => getEntries(configuration),\n output: {\n clean: true, // Clean the output directory before emit\n library: 'IntlLayerContent',\n libraryTarget: 'umd',\n filename: `[name].bundle.js`,\n },\n\n cache: false,\n\n devtool: 'source-map',\n\n // stats: {\n // preset: 'errors-only',\n // warnings: false,\n // },\n ignoreWarnings: [/./],\n resolve: {\n // Resolve TypeScript, JavaScript and JSON files\n extensions: [\n '.ts',\n '.js',\n '.json',\n '.wasm',\n '.ts',\n '.tsx',\n '.mjs',\n '.cjs',\n ],\n modules: [\n // To find the loader module\n join(globalThis.__dirname, '..', 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules', 'intlayer-cli', 'node_modules'), // Or via another project by importing intlayer\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n resolveLoader: {\n // Configure how Webpack finds `loader` modules.\n modules: [\n // To find the loader module\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(\n process.cwd(),\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing @intlayer/webpack\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n module: {\n rules: [\n {\n // Rule for .content.ts files\n test: new RegExp(`(${fileExtensions.join('|')})$`),\n use: [\n {\n // Transpile with esbuild-loader\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n // {\n // // Custom loader to process the transpiled code\n // loader: resolve('./intlayer-loader'),\n // },\n ],\n },\n {\n test: /\\.node$/,\n loader: 'node-loader',\n },\n // Use esbuild to compile JavaScript & TypeScript\n {\n // Match `.js`, `.jsx`, `.ts` or `.tsx` files\n test: /\\.(jsx|js|ts|tsx|mjs|cjs)?$/,\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n\n // JSON files are supported natively by Webpack 5, no specific loader required\n ],\n },\n devServer: devServerConfig,\n\n plugins: [new IntlayerPlugin(configuration)],\n };\n\n return webpackConfig;\n};\n\nexport default getWebpackConfig;\n"],"mappings":";;;;;;;AAWA,MAAa,kBAA0C;CAErD,KAAK;CAEL,MAAM;CACN,YAAY;CAGZ,UAAU;CAGV,oBAAoB;CAGpB,MAAM;CACN,MAAM;CAEN,YAAY;CAEZ,eAAe,EAEb,aAAa,KACf;CAGA,QAAQ,CAAC;AACX;AAEA,MAAa,oBACX,gBAAgC,iBAAiB,MACxB;CACzB,MAAM,EAAE,mBAAmB,cAAc;;;;CAKzC,cAAc;CAsHd,OAAO;EAlHL,MAAM;EAEN,QAAQ;EAER,aAAa,WAAW,aAAa;EACrC,QAAQ;GACN,OAAO;GACP,SAAS;GACT,eAAe;GACf,UAAU;EACZ;EAEA,OAAO;EAEP,SAAS;EAMT,gBAAgB,CAAC,GAAG;EACpB,SAAS;GAEP,YAAY;IACV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,SAAS;IAEP,KAAK,WAAW,WAAW,MAAM,cAAc;IAC/C,KAAK,QAAQ,IAAI,GAAG,cAAc;IAClC,KAAK,QAAQ,IAAI,GAAG,gBAAgB,gBAAgB,cAAc;IAClE,KACE,QAAQ,IAAI,GACZ,gBACA,gBACA,gBACA,qBACA,cACF;GACF;EACF;EAEA,eAAe,EAEb,SAAS;GAEP,KAAK,QAAQ,IAAI,GAAG,cAAc;GAClC,KACE,QAAQ,IAAI,GACZ,gBACA,qBACA,cACF;GACA,KACE,QAAQ,IAAI,GACZ,gBACA,gBACA,gBACA,qBACA,cACF;EACF,EACF;EAEA,QAAQ,EACN,OAAO;GACL;IAEE,MAAM,IAAI,OAAO,IAAI,eAAe,KAAK,GAAG,EAAE,GAAG;IACjD,KAAK,CACH;KAEE,QAAQ;KACR,SAAS,EAEP,QAAQ,SACV;IACF,CAKF;GACF;GACA;IACE,MAAM;IACN,QAAQ;GACV;GAEA;IAEE,MAAM;IACN,QAAQ;IACR,SAAS,EAEP,QAAQ,SACV;GACF;EAGF,EACF;EACA,WAAW;EAEX,SAAS,CAAC,IAAI,eAAe,aAAa,CAAC;CAG1B;AACrB"}
@@ -1,6 +1,5 @@
1
1
  import { IntlayerConfig } from "@intlayer/types/config";
2
2
  import { EntryObject } from "webpack";
3
-
4
3
  //#region src/getEntries.d.ts
5
4
  declare const getEntries: (configuration: IntlayerConfig) => Promise<EntryObject>;
6
5
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"getEntries.d.ts","names":[],"sources":["../../src/getEntries.ts"],"mappings":";;;;cAKa,UAAA,GACX,aAAA,EAAe,cAAA,KACd,OAAA,CAAQ,WAAA"}
1
+ {"version":3,"file":"getEntries.d.ts","names":[],"sources":["../../src/getEntries.ts"],"mappings":";;;cAKa,aAAU,eACN,mBACd,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;AAOA;;cAAa,aAAA"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;;cAOa"}
@@ -1,6 +1,5 @@
1
1
  import { IntlayerConfig } from "@intlayer/types/config";
2
2
  import { Compiler } from "webpack";
3
-
4
3
  //#region src/webpack-plugin.d.ts
5
4
  declare class IntlayerPlugin {
6
5
  private isWatching;
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-plugin.d.ts","names":[],"sources":["../../src/webpack-plugin.ts"],"mappings":";;;;cAmBa,cAAA;EAAA,QACH,UAAA;EAAA,QACA,aAAA;cAEI,aAAA,GAAgB,cAAA;EAItB,KAAA,CAAM,QAAA,EAAU,QAAA,GAAW,OAAA;AAAA"}
1
+ {"version":3,"file":"webpack-plugin.d.ts","names":[],"sources":["../../src/webpack-plugin.ts"],"mappings":";;;cAmBa;UACH;UACA;EAER,YAAY,gBAAgB;EAItB,MAAM,UAAU,WAAW"}
@@ -1,7 +1,6 @@
1
1
  import { IntlayerConfig } from "@intlayer/types/config";
2
2
  import { Configuration } from "webpack";
3
3
  import { Configuration as Configuration$1 } from "webpack-dev-server";
4
-
5
4
  //#region src/webpack.config.d.ts
6
5
  declare const devServerConfig: Configuration$1;
7
6
  declare const getWebpackConfig: (configuration?: IntlayerConfig) => Configuration;
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.config.d.ts","names":[],"sources":["../../src/webpack.config.ts"],"mappings":";;;;;cAWa,eAAA,EAAiB,eAAA;AAAA,cA4BjB,gBAAA,GACX,aAAA,GAAe,cAAA,KACd,aAAA"}
1
+ {"version":3,"file":"webpack.config.d.ts","names":[],"sources":["../../src/webpack.config.ts"],"mappings":";;;;cAWa,iBAAiB;cA4BjB,mBAAgB,gBACZ,mBACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/webpack",
3
- "version": "9.0.0-canary.9",
3
+ "version": "9.0.1",
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": [
@@ -77,23 +77,23 @@
77
77
  "watch": "webpack --config ./webpack.config.ts --watch"
78
78
  },
79
79
  "dependencies": {
80
- "@intlayer/chokidar": "9.0.0-canary.9",
81
- "@intlayer/config": "9.0.0-canary.9",
82
- "@intlayer/dictionaries-entry": "9.0.0-canary.9",
83
- "@intlayer/types": "9.0.0-canary.9",
80
+ "@intlayer/config": "9.0.1",
81
+ "@intlayer/dictionaries-entry": "9.0.1",
82
+ "@intlayer/engine": "9.0.1",
83
+ "@intlayer/types": "9.0.1",
84
84
  "fast-glob": "3.3.3",
85
85
  "webpack": "5.107.2",
86
86
  "webpack-dev-server": "5.2.4"
87
87
  },
88
88
  "devDependencies": {
89
- "@types/node": "25.9.4",
89
+ "@types/node": "26.1.1",
90
90
  "@utils/ts-config": "1.0.4",
91
91
  "@utils/ts-config-types": "1.0.4",
92
92
  "@utils/tsdown-config": "1.0.4",
93
93
  "rimraf": "6.1.3",
94
- "tsdown": "0.21.10",
95
- "typescript": "6.0.3",
96
- "vitest": "4.1.9"
94
+ "tsdown": "0.22.13",
95
+ "typescript": "7.0.2",
96
+ "vitest": "4.1.10"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "webpack": "5.107.2"