@trackunit/iris-app-sdk-rspack 1.11.14 → 1.11.16

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 1.11.16 (2026-01-30)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated iris-app-build-utilities to 1.12.16
6
+ - Updated iris-app-webpack-plugin to 1.11.16
7
+ - Updated iris-app-api to 1.14.15
8
+
9
+ ## 1.11.15 (2026-01-30)
10
+
11
+ ### 🧱 Updated Dependencies
12
+
13
+ - Updated iris-app-build-utilities to 1.12.15
14
+ - Updated iris-app-webpack-plugin to 1.11.15
15
+ - Updated iris-app-api to 1.14.14
16
+
1
17
  ## 1.11.14 (2026-01-29)
2
18
 
3
19
  ### 🧱 Updated Dependencies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-sdk-rspack",
3
- "version": "1.11.14",
3
+ "version": "1.11.16",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "executors": "./executors.json",
@@ -14,8 +14,8 @@
14
14
  "rxjs": "7.8.1",
15
15
  "win-ca": "^3.5.1",
16
16
  "webpack-bundle-analyzer": "^4.8.0",
17
- "@trackunit/iris-app-api": "1.14.13",
18
- "@trackunit/iris-app-webpack-plugin": "1.11.14",
17
+ "@trackunit/iris-app-api": "1.14.15",
18
+ "@trackunit/iris-app-webpack-plugin": "1.11.16",
19
19
  "tslib": "^2.6.2",
20
20
  "ts-checker-rspack-plugin": "^1.1.1"
21
21
  },
@@ -29,45 +29,62 @@ async function* default_1(options, context) {
29
29
  throw new Error("option.rspackConfig is required");
30
30
  }
31
31
  const IrisAppManifest = (await Promise.resolve(`${tileManifestPath}`).then(s => tslib_1.__importStar(require(s)))).default;
32
- const defaultConfig = (0, defaultRspackConfig_1.getDefaultConfig)("development", context.root, projectRootDir, IrisAppManifest, context);
33
- const customConfigFile = await Promise.resolve(`${options.rspackConfig}`).then(s => tslib_1.__importStar(require(s)));
34
- let config = customConfigFile.default(await defaultConfig);
35
- const isPromise = config instanceof Promise;
36
- if (isPromise) {
37
- config = await config;
38
- }
39
- if (context.isVerbose) {
40
- // eslint-disable-next-line no-console
41
- console.log("Using config", JSON.stringify(config.plugins, null, 2));
42
- }
43
- const observable = new rxjs_1.Observable(subscriber => {
44
- // eslint-disable-next-line @typescript-eslint/no-require-imports
45
- const compiler = require("@rspack/core").rspack(config);
46
- const devServer = new dev_server_1.RspackDevServer({
47
- ...config.devServer,
48
- }, compiler);
49
- devServer.startCallback(() => {
50
- const baseUrl = `http${config.devServer?.https ? "s" : ""}://${config.devServer?.host || "localhost"}:${config.devServer?.port || 8080}`;
51
- compiler.hooks.done.tap("iris-serve", (stats) => {
52
- subscriber.next({
53
- baseUrl,
54
- success: !stats.hasErrors(),
55
- stats,
56
- });
57
- });
32
+ // Spawn serverless extensions and get port mapping
33
+ const serverlessResult = await (0, iris_app_build_utilities_1.spawnServerlessExtensions)(IrisAppManifest, context.root);
34
+ let observable;
35
+ try {
36
+ const defaultConfig = (0, defaultRspackConfig_1.getDefaultConfig)("development", context.root, projectRootDir, IrisAppManifest, context, {
37
+ devServerOptions: {
38
+ serverlessPortMap: serverlessResult.portMap,
39
+ },
58
40
  });
59
- return () => {
60
- devServer.stopCallback(() => {
61
- subscriber.complete();
41
+ const customConfigFile = await Promise.resolve(`${options.rspackConfig}`).then(s => tslib_1.__importStar(require(s)));
42
+ let config = customConfigFile.default(await defaultConfig);
43
+ const isPromise = config instanceof Promise;
44
+ if (isPromise) {
45
+ config = await config;
46
+ }
47
+ if (context.isVerbose) {
48
+ // eslint-disable-next-line no-console
49
+ console.log("Using config", JSON.stringify(config.plugins, null, 2));
50
+ }
51
+ observable = new rxjs_1.Observable(subscriber => {
52
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
53
+ const compiler = require("@rspack/core").rspack(config);
54
+ const devServer = new dev_server_1.RspackDevServer({
55
+ ...config.devServer,
56
+ }, compiler);
57
+ devServer.startCallback(() => {
58
+ const baseUrl = `http${config.devServer?.https ? "s" : ""}://${config.devServer?.host || "localhost"}:${config.devServer?.port || 8080}`;
59
+ compiler.hooks.done.tap("iris-serve", (stats) => {
60
+ subscriber.next({
61
+ baseUrl,
62
+ success: !stats.hasErrors(),
63
+ stats,
64
+ });
65
+ });
62
66
  });
63
- };
64
- }).pipe(op.tap(({ stats }) => {
65
- // eslint-disable-next-line no-console
66
- console.info(stats.toString(config.stats));
67
- }), op.map(({ baseUrl, success }) => ({
68
- baseUrl,
69
- success,
70
- })));
67
+ return () => {
68
+ devServer.stopCallback(() => {
69
+ subscriber.complete();
70
+ });
71
+ };
72
+ }).pipe(op.tap(({ stats }) => {
73
+ // eslint-disable-next-line no-console
74
+ console.info(stats.toString(config.stats));
75
+ }), op.map(({ baseUrl, success }) => ({
76
+ baseUrl,
77
+ success,
78
+ })), op.finalize(() => {
79
+ // Cleanup serverless extension processes
80
+ serverlessResult.cleanup();
81
+ }));
82
+ }
83
+ catch (error) {
84
+ // Ensure cleanup runs if setup fails before observable is created
85
+ serverlessResult.cleanup();
86
+ throw error;
87
+ }
71
88
  return yield* (0, rxjs_for_await_1.eachValueFrom)(observable);
72
89
  }
73
90
  //# sourceMappingURL=executor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/serve/executor.ts"],"names":[],"mappings":";;AAqBA,4BAgEC;;AAnFD,wEAAoE;AACpE,kFAA8F;AAC9F,+BAA4B;AAC5B,+BAAkC;AAClC,2DAAqC;AAGrC,mDAAqD;AACrD,kBAAgB;AAChB,sEAAgE;AAGhE;;;;;;GAMG;AACY,KAAK,SAAS,CAAC,WAAE,OAA4B,EAAE,OAAwB;IACpF,MAAM,IAAA,8CAAmB,EAAC,KAAK,CAAC,CAAC;IACjC,MAAM,WA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AAC1C,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/src/utils/rxjs-for-await\";\nimport { checkPackageVersion, enableTsConfigPath } from \"@trackunit/iris-app-build-utilities\";\nimport { join } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\n\nimport { Configuration } from \"@rspack/core\";\nimport { RspackDevServer } from \"@rspack/dev-server\";\nimport \"win-ca\";\nimport { getDefaultConfig } from \"../utils/defaultRspackConfig\";\nimport { ServeExecutorSchema } from \"./schema\";\n\n/**\n * Serve executor for serving iris apps.\n *\n * @param {ServeExecutorSchema} options serve executor options for this nx executor\n * @param {ExecutorContext} context serve executor context for this nx executor\n * @yields {AsyncGenerator<any, void, unknown>} the serve observable\n */\nexport default async function* (options: ServeExecutorSchema, context: ExecutorContext) {\n await checkPackageVersion(false);\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n const tileManifestPath = join(context.root, projectRoot, \"iris-app-manifest.ts\");\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.rspackConfig) {\n throw new Error(\"option.rspackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = getDefaultConfig(\"development\", context.root, projectRootDir, IrisAppManifest, context);\n const customConfigFile = await import(options.rspackConfig);\n\n let config = customConfigFile.default(await defaultConfig);\n const isPromise = config instanceof Promise;\n if (isPromise) {\n config = await config;\n }\n\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Using config\", JSON.stringify(config.plugins, null, 2));\n }\n const observable = new Observable<{ baseUrl: string; success: boolean; stats: any }>(subscriber => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const compiler = require(\"@rspack/core\").rspack(config as Configuration);\n const devServer = new RspackDevServer(\n {\n ...config.devServer,\n },\n compiler\n );\n\n devServer.startCallback(() => {\n const baseUrl = `http${config.devServer?.https ? \"s\" : \"\"}://${config.devServer?.host || \"localhost\"}:${config.devServer?.port || 8080}`;\n\n compiler.hooks.done.tap(\"iris-serve\", (stats: any) => {\n subscriber.next({\n baseUrl,\n success: !stats.hasErrors(),\n stats,\n });\n });\n });\n\n return () => {\n devServer.stopCallback(() => {\n subscriber.complete();\n });\n };\n }).pipe(\n op.tap(({ stats }) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString(config.stats));\n }),\n op.map(({ baseUrl, success }) => ({\n baseUrl,\n success,\n }))\n );\n\n return yield* eachValueFrom(observable);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/serve/executor.ts"],"names":[],"mappings":";;AAyBA,4BAmFC;;AA1GD,wEAAoE;AACpE,kFAI6C;AAC7C,+BAA4B;AAC5B,+BAAkC;AAClC,2DAAqC;AAGrC,mDAAqD;AACrD,kBAAgB;AAChB,sEAAgE;AAGhE;;;;;;GAMG;AACY,KAAK,SAAS,CAAC,WAAE,OAA4B,EAAE,OAAwB;IACpF,MAAM,IAAA,8CAAmB,EAAC,KAAK,CAAC,CAAC;IACjC,MAAM,WAAW,GAAG,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAE,CAAC,IAAI,CAAC;IACxF,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,sBAAsB,CAAC,CAAC;IACjF,IAAA,6CAAkB,EAAC;QACjB,cAAc;KACf,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,eAAe,GAAG,CAAC,yBAAa,gBAAgB,+CAAC,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ent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/src/utils/rxjs-for-await\";\nimport {\n checkPackageVersion,\n enableTsConfigPath,\n spawnServerlessExtensions,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { join } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\n\nimport { Configuration } from \"@rspack/core\";\nimport { RspackDevServer } from \"@rspack/dev-server\";\nimport \"win-ca\";\nimport { getDefaultConfig } from \"../utils/defaultRspackConfig\";\nimport { ServeExecutorSchema } from \"./schema\";\n\n/**\n * Serve executor for serving iris apps.\n *\n * @param {ServeExecutorSchema} options serve executor options for this nx executor\n * @param {ExecutorContext} context serve executor context for this nx executor\n * @yields {AsyncGenerator<any, void, unknown>} the serve observable\n */\nexport default async function* (options: ServeExecutorSchema, context: ExecutorContext) {\n await checkPackageVersion(false);\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n const tileManifestPath = join(context.root, projectRoot, \"iris-app-manifest.ts\");\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.rspackConfig) {\n throw new Error(\"option.rspackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n\n // Spawn serverless extensions and get port mapping\n const serverlessResult = await spawnServerlessExtensions(IrisAppManifest, context.root);\n\n let observable: Observable<{ baseUrl: string; success: boolean }>;\n try {\n const defaultConfig = getDefaultConfig(\"development\", context.root, projectRootDir, IrisAppManifest, context, {\n devServerOptions: {\n serverlessPortMap: serverlessResult.portMap,\n },\n });\n const customConfigFile = await import(options.rspackConfig);\n\n let config = customConfigFile.default(await defaultConfig);\n const isPromise = config instanceof Promise;\n if (isPromise) {\n config = await config;\n }\n\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Using config\", JSON.stringify(config.plugins, null, 2));\n }\n observable = new Observable<{ baseUrl: string; success: boolean; stats: any }>(subscriber => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const compiler = require(\"@rspack/core\").rspack(config as Configuration);\n const devServer = new RspackDevServer(\n {\n ...config.devServer,\n },\n compiler\n );\n\n devServer.startCallback(() => {\n const baseUrl = `http${config.devServer?.https ? \"s\" : \"\"}://${config.devServer?.host || \"localhost\"}:${config.devServer?.port || 8080}`;\n\n compiler.hooks.done.tap(\"iris-serve\", (stats: any) => {\n subscriber.next({\n baseUrl,\n success: !stats.hasErrors(),\n stats,\n });\n });\n });\n\n return () => {\n devServer.stopCallback(() => {\n subscriber.complete();\n });\n };\n }).pipe(\n op.tap(({ stats }) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString(config.stats));\n }),\n op.map(({ baseUrl, success }) => ({\n baseUrl,\n success,\n })),\n op.finalize(() => {\n // Cleanup serverless extension processes\n serverlessResult.cleanup();\n })\n );\n } catch (error) {\n // Ensure cleanup runs if setup fails before observable is created\n serverlessResult.cleanup();\n throw error;\n }\n\n return yield* eachValueFrom(observable);\n}\n"]}
@@ -1,7 +1,11 @@
1
1
  import { ExecutorContext } from "@nx/devkit";
2
2
  import * as rspack from "@rspack/core";
3
3
  import { IrisAppManifest } from "@trackunit/iris-app-api";
4
+ import { DevServerOptions } from "@trackunit/iris-app-build-utilities";
4
5
  type RspackConfiguration = rspack.Configuration;
6
+ export interface GetDefaultConfigOptions {
7
+ devServerOptions?: DevServerOptions;
8
+ }
5
9
  /**
6
10
  * Gets the default webpack config.
7
11
  *
@@ -9,9 +13,11 @@ type RspackConfiguration = rspack.Configuration;
9
13
  * @param nxRootDir the root of the nx workspace
10
14
  * @param appDir the app directory
11
15
  * @param irisAppManifest the iris app manifest
16
+ * @param _context the executor context
17
+ * @param options additional configuration options
12
18
  * @returns { Promise<RspackConfiguration> } the default webpack config
13
19
  */
14
- export declare const getDefaultConfig: (mode: "production" | "development", nxRootDir: string, appDir: string, irisAppManifest: IrisAppManifest, _context: ExecutorContext) => Promise<RspackConfiguration>;
20
+ export declare const getDefaultConfig: (mode: "production" | "development", nxRootDir: string, appDir: string, irisAppManifest: IrisAppManifest, _context: ExecutorContext, options?: GetDefaultConfigOptions) => Promise<RspackConfiguration>;
15
21
  /**
16
22
  * Gets the configuration for internal apps by removing the TypeScript checker plugin.
17
23
  * Internal apps in this repo should use this function to disable the default TypeScript checking
@@ -21,9 +21,11 @@ if (process.env.BUNDLE_ANALYSE === "true") {
21
21
  * @param nxRootDir the root of the nx workspace
22
22
  * @param appDir the app directory
23
23
  * @param irisAppManifest the iris app manifest
24
+ * @param _context the executor context
25
+ * @param options additional configuration options
24
26
  * @returns { Promise<RspackConfiguration> } the default webpack config
25
27
  */
26
- const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest, _context) => {
28
+ const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest, _context, options = {}) => {
27
29
  const relativeAppDir = appDir.split(nxRootDir)[1] || "<unknown appdir>";
28
30
  const copyPatterns = (0, iris_app_build_utilities_1.getCopyPatterns)({
29
31
  nxRootDir,
@@ -42,7 +44,7 @@ const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest, _conte
42
44
  target: "web",
43
45
  entry: {},
44
46
  devtool: false,
45
- devServer: await (0, iris_app_build_utilities_1.getIrisAppRspackDevServer)(),
47
+ devServer: await (0, iris_app_build_utilities_1.getIrisAppRspackDevServer)({}, options.devServerOptions),
46
48
  resolve: {
47
49
  extensions: [".tsx", ".ts", ".jsx", ".js", ".json"],
48
50
  alias: await (0, iris_app_build_utilities_1.getAliasesFromTsConfig)({ nxRootDir }),
@@ -1 +1 @@
1
- {"version":3,"file":"defaultRspackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/utils/defaultRspackConfig.ts"],"names":[],"mappings":";;;;AACA,6DAAuC;AAEvC,kFAM6C;AAC7C,gFAAmF;AACnF,mDAA6B;AAC7B,uEAAiE;AAIjE,IAAI,oBAAoB,GAAwC,IAAI,CAAC;AACrE,IA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C;oBAChC,SAAS,EAAE,SAAS;oBACpB,MAAM;oBACN,QAAQ,EAAE,eAAe;iBAC1B,CAAC;gBACF,IAAI,MAAM,CAAC,YAAY,CAAC;oBACtB,iCAAiC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;oBACrD,8BAA8B,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;iBACnD,CAAC;gBACF,IAAI,MAAM,CAAC,gBAAgB,CAAC;oBAC1B,QAAQ,EAAE,YAAY;iBACvB,CAAC;gBACF,IAAI,gDAAqB,CAAC;oBACxB,KAAK,EAAE,IAAI;oBACX,UAAU,EAAE;wBACV,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;qBAC/C;iBACF,CAAC;gBACF,oBAAoB;aACrB,CAAC,MAAM,CAAC,OAAO,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC;AApLW,QAAA,gBAAgB,oBAoL3B;AAEF;;;;;;;GAOG;AACI,MAAM,yBAAyB,GAAG,CAAC,aAAkC,EAAuB,EAAE;IACnG,MAAM,eAAe,GAAG,aAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAEpD,OAAO;QACL,GAAG,aAAa;QAChB,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;YACvC,MAAM,UAAU,GAAG,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC;YAC5C,OAAO,UAAU,KAAK,uBAAuB,CAAC;QAChD,CAAC,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,yBAAyB,6BAUpC","sourcesContent":["import { ExecutorContext } from \"@nx/devkit\";\nimport * as rspack from \"@rspack/core\";\nimport { IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport {\n getAliasesFromTsConfig,\n getCopyPatterns,\n getExposedExtensions,\n getIrisAppRspackDevServer,\n getSharedDependencies,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { TrackunitIrisAppWebpackPlugin } from \"@trackunit/iris-app-webpack-plugin\";\nimport * as path from \"path\";\nimport { TsCheckerRspackPlugin } from \"ts-checker-rspack-plugin\";\n\ntype RspackConfiguration = rspack.Configuration;\n\nlet BundleAnalyzerPlugin: rspack.WebpackPluginInstance | null = null;\nif (process.env.BUNDLE_ANALYSE === \"true\") {\n // doing require here to avoid dependency on webpack-bundle-analyzer directly\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const BundleAnalyzerPluginConstructor = require(\"webpack-bundle-analyzer\").BundleAnalyzerPlugin;\n BundleAnalyzerPlugin = new BundleAnalyzerPluginConstructor({ analyzerMode: \"static\" });\n}\n\n/**\n * Gets the default webpack config.\n *\n * @param mode mode either \"production\" or \"development\"\n * @param nxRootDir the root of the nx workspace\n * @param appDir the app directory\n * @param irisAppManifest the iris app manifest\n * @returns { Promise<RspackConfiguration> } the default webpack config\n */\nexport const getDefaultConfig = async (\n mode: \"production\" | \"development\",\n nxRootDir: string,\n appDir: string,\n irisAppManifest: IrisAppManifest,\n _context: ExecutorContext\n): Promise<RspackConfiguration> => {\n const relativeAppDir = appDir.split(nxRootDir)[1] || \"<unknown appdir>\";\n\n const copyPatterns = getCopyPatterns({\n nxRootDir,\n appDir,\n manifest: irisAppManifest,\n mode,\n });\n\n const combinedConfig = async (incomingConfig: rspack.Configuration): Promise<rspack.Configuration> => {\n return {\n ...incomingConfig,\n mode: mode,\n output: {\n publicPath: \"auto\",\n path: path.join(nxRootDir, \"dist\", relativeAppDir),\n },\n target: \"web\",\n entry: {},\n devtool: false,\n devServer: await getIrisAppRspackDevServer(),\n resolve: {\n extensions: [\".tsx\", \".ts\", \".jsx\", \".js\", \".json\"],\n alias: await getAliasesFromTsConfig({ nxRootDir }),\n },\n optimization:\n mode === \"production\"\n ? incomingConfig.optimization\n : {\n ...incomingConfig.optimization,\n splitChunks: {\n cacheGroups: {\n translations: {\n test: /[\\\\/]locales[\\\\/](.*?)[\\\\/]translation\\.json$/,\n name(module) {\n // Extract the language code from the path\n const match = module.identifier().match(/[\\\\/]locales[\\\\/](.*?)[\\\\/]translation\\.json$/);\n const language = match ? match[1] : \"unknown\";\n return `translations-${language}`;\n },\n chunks: \"all\",\n enforce: true,\n priority: 10,\n },\n },\n },\n },\n module: {\n rules: [\n {\n test: /\\.(jsx?|tsx?)$/,\n exclude: /(vendor|node_modules|dist)/,\n loader: \"builtin:swc-loader\",\n options: {\n jsc: {\n parser: {\n syntax: \"typescript\",\n jsx: true,\n },\n transform: {\n react: {\n runtime: \"automatic\",\n },\n },\n },\n },\n },\n {\n test: /\\.svg$/,\n issuer: /\\.[jt]sx?$/,\n oneOf: [\n {\n resourceQuery: /react/, // if import has ?react in the query so .svg?react\n use: [\n {\n loader: \"@svgr/webpack\",\n options: {\n typescript: true,\n svgo: false,\n titleProp: true,\n ref: true,\n exportType: \"named\",\n namedExport: \"ReactComponent\",\n },\n },\n ],\n },\n {\n type: \"asset\",\n generator: {\n filename: mode === \"production\" ? \"static/media/[hash][ext]\" : \"static/media/[name][ext]\",\n },\n },\n ],\n },\n {\n test: /\\.ico|.png|.jpe?g|.gif|.eot|.ttf|.woff|.woff2$/,\n type: \"asset\",\n },\n {\n test: /\\.(js|mjs)$/,\n include: [\n /node_modules\\/@apollo\\/client/,\n /node_modules\\/framer-motion/,\n /node_modules\\/uuid/,\n /node_modules\\/html-parse-stringify/,\n ],\n type: \"javascript/auto\",\n resolve: {\n fullySpecified: false,\n },\n },\n {\n test: /\\.(css|s[ac]ss)$/i,\n use: [\n \"style-loader\",\n \"css-loader\",\n {\n loader: \"postcss-loader\",\n options: {\n postcssOptions: {\n plugins: {\n \"postcss-import\": {},\n \"tailwindcss/nesting\": {},\n tailwindcss: {\n config: path.resolve(appDir, \"tailwind.config.js\"),\n },\n autoprefixer: {},\n },\n },\n },\n },\n ],\n },\n ],\n },\n plugins: [\n new rspack.container.ModuleFederationPlugin({\n name: irisAppManifest.moduleFederationName,\n filename: \"remoteEntry.js\",\n library: { type: \"global\", name: irisAppManifest.moduleFederationName },\n remotes: {},\n exposes: await getExposedExtensions({\n nxRootDir,\n manifest: irisAppManifest,\n }),\n shared: getSharedDependencies({ manifest: irisAppManifest }),\n }),\n\n new TrackunitIrisAppWebpackPlugin({\n nxRootDir: nxRootDir,\n appDir,\n manifest: irisAppManifest,\n }),\n new rspack.DefinePlugin({\n \"process.env.IRIS_APP_SENTRY_DSN\": JSON.stringify(\"\"),\n \"process.env.IRIS_APP_VERSION\": JSON.stringify(\"\"),\n }),\n new rspack.CopyRspackPlugin({\n patterns: copyPatterns,\n }),\n new TsCheckerRspackPlugin({\n async: true,\n typescript: {\n configFile: path.join(appDir, \"tsconfig.json\"),\n },\n }),\n BundleAnalyzerPlugin,\n ].filter(Boolean),\n };\n };\n\n return await combinedConfig({});\n};\n\n/**\n * Gets the configuration for internal apps by removing the TypeScript checker plugin.\n * Internal apps in this repo should use this function to disable the default TypeScript checking\n * that is included in the base rspack configuration.\n *\n * @param configuration - The rspack configuration\n * @returns { RspackConfiguration } The configuration without TsCheckerRspackPlugin\n */\nexport const getConfigWithoutTsChecker = (configuration: RspackConfiguration): RspackConfiguration => {\n const existingPlugins = configuration.plugins || [];\n\n return {\n ...configuration,\n plugins: existingPlugins.filter(plugin => {\n const pluginName = plugin?.constructor.name;\n return pluginName !== \"TsCheckerRspackPlugin\";\n }),\n };\n};\n"]}
1
+ {"version":3,"file":"defaultRspackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/utils/defaultRspackConfig.ts"],"names":[],"mappings":";;;;AACA,6DAAuC;AAEvC,kFAO6C;AAC7C,gFAAmF;AACnF,mDAA6B;AAC7B,uEAAiE;AAIjE,IAAI,oBAAoB,GAAwC,IAAI,CAAC;AACrE,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;IAC1C,6EAA6E;IAC7E,iEAAiE;IACjE,MAAM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;oBACN,QAAQ,EAAE,eAAe;iBAC1B,CAAC;gBACF,IAAI,MAAM,CAAC,YAAY,CAAC;oBACtB,iCAAiC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;oBACrD,8BAA8B,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;iBACnD,CAAC;gBACF,IAAI,MAAM,CAAC,gBAAgB,CAAC;oBAC1B,QAAQ,EAAE,YAAY;iBACvB,CAAC;gBACF,IAAI,gDAAqB,CAAC;oBACxB,KAAK,EAAE,IAAI;oBACX,UAAU,EAAE;wBACV,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;qBAC/C;iBACF,CAAC;gBACF,oBAAoB;aACrB,CAAC,MAAM,CAAC,OAAO,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC;AArLW,QAAA,gBAAgB,oBAqL3B;AAEF;;;;;;;GAOG;AACI,MAAM,yBAAyB,GAAG,CAAC,aAAkC,EAAuB,EAAE;IACnG,MAAM,eAAe,GAAG,aAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAEpD,OAAO;QACL,GAAG,aAAa;QAChB,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;YACvC,MAAM,UAAU,GAAG,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC;YAC5C,OAAO,UAAU,KAAK,uBAAuB,CAAC;QAChD,CAAC,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,yBAAyB,6BAUpC","sourcesContent":["import { ExecutorContext } from \"@nx/devkit\";\nimport * as rspack from \"@rspack/core\";\nimport { IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport {\n DevServerOptions,\n getAliasesFromTsConfig,\n getCopyPatterns,\n getExposedExtensions,\n getIrisAppRspackDevServer,\n getSharedDependencies,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { TrackunitIrisAppWebpackPlugin } from \"@trackunit/iris-app-webpack-plugin\";\nimport * as path from \"path\";\nimport { TsCheckerRspackPlugin } from \"ts-checker-rspack-plugin\";\n\ntype RspackConfiguration = rspack.Configuration;\n\nlet BundleAnalyzerPlugin: rspack.WebpackPluginInstance | null = null;\nif (process.env.BUNDLE_ANALYSE === \"true\") {\n // doing require here to avoid dependency on webpack-bundle-analyzer directly\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const BundleAnalyzerPluginConstructor = require(\"webpack-bundle-analyzer\").BundleAnalyzerPlugin;\n BundleAnalyzerPlugin = new BundleAnalyzerPluginConstructor({ analyzerMode: \"static\" });\n}\n\nexport interface GetDefaultConfigOptions {\n devServerOptions?: DevServerOptions;\n}\n\n/**\n * Gets the default webpack config.\n *\n * @param mode mode either \"production\" or \"development\"\n * @param nxRootDir the root of the nx workspace\n * @param appDir the app directory\n * @param irisAppManifest the iris app manifest\n * @param _context the executor context\n * @param options additional configuration options\n * @returns { Promise<RspackConfiguration> } the default webpack config\n */\nexport const getDefaultConfig = async (\n mode: \"production\" | \"development\",\n nxRootDir: string,\n appDir: string,\n irisAppManifest: IrisAppManifest,\n _context: ExecutorContext,\n options: GetDefaultConfigOptions = {}\n): Promise<RspackConfiguration> => {\n const relativeAppDir = appDir.split(nxRootDir)[1] || \"<unknown appdir>\";\n\n const copyPatterns = getCopyPatterns({\n nxRootDir,\n appDir,\n manifest: irisAppManifest,\n mode,\n });\n\n const combinedConfig = async (incomingConfig: rspack.Configuration): Promise<rspack.Configuration> => {\n return {\n ...incomingConfig,\n mode: mode,\n output: {\n publicPath: \"auto\",\n path: path.join(nxRootDir, \"dist\", relativeAppDir),\n },\n target: \"web\",\n entry: {},\n devtool: false,\n devServer: await getIrisAppRspackDevServer({}, options.devServerOptions),\n resolve: {\n extensions: [\".tsx\", \".ts\", \".jsx\", \".js\", \".json\"],\n alias: await getAliasesFromTsConfig({ nxRootDir }),\n },\n optimization:\n mode === \"production\"\n ? incomingConfig.optimization\n : {\n ...incomingConfig.optimization,\n splitChunks: {\n cacheGroups: {\n translations: {\n test: /[\\\\/]locales[\\\\/](.*?)[\\\\/]translation\\.json$/,\n name(module) {\n // Extract the language code from the path\n const match = module.identifier().match(/[\\\\/]locales[\\\\/](.*?)[\\\\/]translation\\.json$/);\n const language = match ? match[1] : \"unknown\";\n return `translations-${language}`;\n },\n chunks: \"all\",\n enforce: true,\n priority: 10,\n },\n },\n },\n },\n module: {\n rules: [\n {\n test: /\\.(jsx?|tsx?)$/,\n exclude: /(vendor|node_modules|dist)/,\n loader: \"builtin:swc-loader\",\n options: {\n jsc: {\n parser: {\n syntax: \"typescript\",\n jsx: true,\n },\n transform: {\n react: {\n runtime: \"automatic\",\n },\n },\n },\n },\n },\n {\n test: /\\.svg$/,\n issuer: /\\.[jt]sx?$/,\n oneOf: [\n {\n resourceQuery: /react/, // if import has ?react in the query so .svg?react\n use: [\n {\n loader: \"@svgr/webpack\",\n options: {\n typescript: true,\n svgo: false,\n titleProp: true,\n ref: true,\n exportType: \"named\",\n namedExport: \"ReactComponent\",\n },\n },\n ],\n },\n {\n type: \"asset\",\n generator: {\n filename: mode === \"production\" ? \"static/media/[hash][ext]\" : \"static/media/[name][ext]\",\n },\n },\n ],\n },\n {\n test: /\\.ico|.png|.jpe?g|.gif|.eot|.ttf|.woff|.woff2$/,\n type: \"asset\",\n },\n {\n test: /\\.(js|mjs)$/,\n include: [\n /node_modules\\/@apollo\\/client/,\n /node_modules\\/framer-motion/,\n /node_modules\\/uuid/,\n /node_modules\\/html-parse-stringify/,\n ],\n type: \"javascript/auto\",\n resolve: {\n fullySpecified: false,\n },\n },\n {\n test: /\\.(css|s[ac]ss)$/i,\n use: [\n \"style-loader\",\n \"css-loader\",\n {\n loader: \"postcss-loader\",\n options: {\n postcssOptions: {\n plugins: {\n \"postcss-import\": {},\n \"tailwindcss/nesting\": {},\n tailwindcss: {\n config: path.resolve(appDir, \"tailwind.config.js\"),\n },\n autoprefixer: {},\n },\n },\n },\n },\n ],\n },\n ],\n },\n plugins: [\n new rspack.container.ModuleFederationPlugin({\n name: irisAppManifest.moduleFederationName,\n filename: \"remoteEntry.js\",\n library: { type: \"global\", name: irisAppManifest.moduleFederationName },\n remotes: {},\n exposes: await getExposedExtensions({\n nxRootDir,\n manifest: irisAppManifest,\n }),\n shared: getSharedDependencies({ manifest: irisAppManifest }),\n }),\n\n new TrackunitIrisAppWebpackPlugin({\n nxRootDir: nxRootDir,\n appDir,\n manifest: irisAppManifest,\n }),\n new rspack.DefinePlugin({\n \"process.env.IRIS_APP_SENTRY_DSN\": JSON.stringify(\"\"),\n \"process.env.IRIS_APP_VERSION\": JSON.stringify(\"\"),\n }),\n new rspack.CopyRspackPlugin({\n patterns: copyPatterns,\n }),\n new TsCheckerRspackPlugin({\n async: true,\n typescript: {\n configFile: path.join(appDir, \"tsconfig.json\"),\n },\n }),\n BundleAnalyzerPlugin,\n ].filter(Boolean),\n };\n };\n\n return await combinedConfig({});\n};\n\n/**\n * Gets the configuration for internal apps by removing the TypeScript checker plugin.\n * Internal apps in this repo should use this function to disable the default TypeScript checking\n * that is included in the base rspack configuration.\n *\n * @param configuration - The rspack configuration\n * @returns { RspackConfiguration } The configuration without TsCheckerRspackPlugin\n */\nexport const getConfigWithoutTsChecker = (configuration: RspackConfiguration): RspackConfiguration => {\n const existingPlugins = configuration.plugins || [];\n\n return {\n ...configuration,\n plugins: existingPlugins.filter(plugin => {\n const pluginName = plugin?.constructor.name;\n return pluginName !== \"TsCheckerRspackPlugin\";\n }),\n };\n};\n"]}