@trackunit/iris-app-sdk-webpack 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 +16 -0
- package/package.json +4 -4
- package/src/executors/serve/executor.d.ts +1 -1
- package/src/executors/serve/executor.js +35 -18
- package/src/executors/serve/executor.js.map +1 -1
- package/src/executors/utils/defaultWebpackConfig.d.ts +6 -1
- package/src/executors/utils/defaultWebpackConfig.js +3 -2
- package/src/executors/utils/defaultWebpackConfig.js.map +1 -1
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-webpack",
|
|
3
|
-
"version": "1.11.
|
|
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",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"win-ca": "^3.5.1",
|
|
16
16
|
"copy-webpack-plugin": "11.0.0",
|
|
17
17
|
"webpack-bundle-analyzer": "^4.8.0",
|
|
18
|
-
"@trackunit/iris-app-build-utilities": "1.12.
|
|
19
|
-
"@trackunit/iris-app-api": "1.14.
|
|
20
|
-
"@trackunit/iris-app-webpack-plugin": "1.11.
|
|
18
|
+
"@trackunit/iris-app-build-utilities": "1.12.16",
|
|
19
|
+
"@trackunit/iris-app-api": "1.14.15",
|
|
20
|
+
"@trackunit/iris-app-webpack-plugin": "1.11.16",
|
|
21
21
|
"tslib": "^2.6.2"
|
|
22
22
|
},
|
|
23
23
|
"types": "./src/index.d.ts",
|
|
@@ -9,4 +9,4 @@ import { ServeExecutorSchema } from "./schema";
|
|
|
9
9
|
* @param {ExecutorContext} context serve executor context for this nx executor
|
|
10
10
|
* @yields {AsyncGenerator<any, void, unknown>} the serve observable
|
|
11
11
|
*/
|
|
12
|
-
export default function (options: ServeExecutorSchema, context: ExecutorContext): AsyncGenerator<
|
|
12
|
+
export default function (options: ServeExecutorSchema, context: ExecutorContext): AsyncGenerator<unknown, any, any>;
|
|
@@ -29,26 +29,43 @@ async function* default_1(options, context) {
|
|
|
29
29
|
throw new Error("option.webpackConfig is required");
|
|
30
30
|
}
|
|
31
31
|
const IrisAppManifest = (await Promise.resolve(`${tileManifestPath}`).then(s => tslib_1.__importStar(require(s)))).default;
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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, defaultWebpackConfig_1.getDefaultConfig)("development", context.root, projectRootDir, IrisAppManifest, {
|
|
37
|
+
devServerOptions: {
|
|
38
|
+
serverlessPortMap: serverlessResult.portMap,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
const customConfigFile = await Promise.resolve(`${options.webpackConfig}`).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 = (0, webpackDevServer_1.doRunWebpackDevServer)(config).pipe(op.tap(({ stats }) => {
|
|
52
|
+
// eslint-disable-next-line no-console
|
|
53
|
+
console.info(stats.toString(config.stats));
|
|
54
|
+
}), op.map(({ baseUrl, stats }) => {
|
|
55
|
+
return {
|
|
56
|
+
baseUrl,
|
|
57
|
+
success: !stats.hasErrors(),
|
|
58
|
+
};
|
|
59
|
+
}), op.finalize(() => {
|
|
60
|
+
// Cleanup serverless extension processes
|
|
61
|
+
serverlessResult.cleanup();
|
|
62
|
+
}));
|
|
38
63
|
}
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
64
|
+
catch (error) {
|
|
65
|
+
// Ensure cleanup runs if setup fails before observable is created
|
|
66
|
+
serverlessResult.cleanup();
|
|
67
|
+
throw error;
|
|
42
68
|
}
|
|
43
|
-
const observable = (0, webpackDevServer_1.doRunWebpackDevServer)(config).pipe(op.tap(({ stats }) => {
|
|
44
|
-
// eslint-disable-next-line no-console
|
|
45
|
-
console.info(stats.toString(config.stats));
|
|
46
|
-
}), op.map(({ baseUrl, stats }) => {
|
|
47
|
-
return {
|
|
48
|
-
baseUrl,
|
|
49
|
-
success: !stats.hasErrors(),
|
|
50
|
-
};
|
|
51
|
-
}));
|
|
52
69
|
return yield* (0, rxjs_for_await_1.eachValueFrom)(observable);
|
|
53
70
|
}
|
|
54
71
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/webpack/src/executors/serve/executor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/webpack/src/executors/serve/executor.ts"],"names":[],"mappings":";;AA0BA,4BA0DC;;AAnFD,wEAAoE;AACpE,kFAI6C;AAC7C,+BAA4B;AAE5B,2DAAqC;AAErC,8BAA4B;AAC5B,kBAAgB;AAChB,wEAAiE;AAEjE,yDAA2D;AAI3D;;;;;;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,aAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IACD,MAAM,eAAe,GAAG,CAAC,yBAAa,gBAAgB,+CAAC,CAAC,CAAC,OAAO,CAAC;IAEjE,mDAAmD;IACnD,MAAM,gBAAgB,GAAG,MAAM,IAAA,oDAAyB,EAAC,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAExF,IAAI,UAA6D,CAAC;IAClE,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,IAAA,uCAAgB,EAAC,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE;YACnG,gBAA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AAO,KAAK,CAAC,CAAC,IAAA,8BAAa,EAAC,UAA4C,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import { 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 \"webpack-dev-server\";\nimport \"win-ca\";\nimport { getDefaultConfig } from \"../utils/defaultWebpackConfig\";\nimport { ServeExecutorSchema } from \"./schema\";\nimport { doRunWebpackDevServer } from \"./webpackDevServer\";\n\nimport type webpack = require(\"webpack\");\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.webpackConfig) {\n throw new Error(\"option.webpackConfig 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, {\n devServerOptions: {\n serverlessPortMap: serverlessResult.portMap,\n },\n });\n const customConfigFile = await import(options.webpackConfig);\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 = doRunWebpackDevServer(config).pipe(\n op.tap(({ stats }) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString((config as webpack.Configuration).stats));\n }),\n op.map(({ baseUrl, stats }) => {\n return {\n baseUrl,\n success: !stats.hasErrors(),\n };\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 as unknown as Observable<unknown>);\n}\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { IrisAppManifest } from "@trackunit/iris-app-api";
|
|
2
|
+
import { DevServerOptions } from "@trackunit/iris-app-build-utilities";
|
|
2
3
|
import * as webpack from "webpack";
|
|
3
4
|
import "webpack-dev-server";
|
|
4
5
|
type WebpackConfiguration = webpack.Configuration;
|
|
6
|
+
export interface GetDefaultConfigOptions {
|
|
7
|
+
devServerOptions?: DevServerOptions;
|
|
8
|
+
}
|
|
5
9
|
/**
|
|
6
10
|
* Gets the default webpack config.
|
|
7
11
|
*
|
|
@@ -9,7 +13,8 @@ type WebpackConfiguration = webpack.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 options additional configuration options
|
|
12
17
|
* @returns { Promise<WebpackConfiguration> } the default webpack config
|
|
13
18
|
*/
|
|
14
|
-
export declare const getDefaultConfig: (mode: "production" | "development", nxRootDir: string, appDir: string, irisAppManifest: IrisAppManifest) => Promise<WebpackConfiguration>;
|
|
19
|
+
export declare const getDefaultConfig: (mode: "production" | "development", nxRootDir: string, appDir: string, irisAppManifest: IrisAppManifest, options?: GetDefaultConfigOptions) => Promise<WebpackConfiguration>;
|
|
15
20
|
export {};
|
|
@@ -23,9 +23,10 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
|
23
23
|
* @param nxRootDir the root of the nx workspace
|
|
24
24
|
* @param appDir the app directory
|
|
25
25
|
* @param irisAppManifest the iris app manifest
|
|
26
|
+
* @param options additional configuration options
|
|
26
27
|
* @returns { Promise<WebpackConfiguration> } the default webpack config
|
|
27
28
|
*/
|
|
28
|
-
const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest) => {
|
|
29
|
+
const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest, options = {}) => {
|
|
29
30
|
const relativeAppDir = appDir.split(nxRootDir)[1] || "<unknown appdir>";
|
|
30
31
|
const copyPatterns = (0, iris_app_build_utilities_1.getCopyPatterns)({
|
|
31
32
|
nxRootDir,
|
|
@@ -41,7 +42,7 @@ const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest) => {
|
|
|
41
42
|
},
|
|
42
43
|
entry: {},
|
|
43
44
|
devtool: false,
|
|
44
|
-
devServer: await (0, iris_app_build_utilities_1.getIrisAppWebpackDevServer)(),
|
|
45
|
+
devServer: await (0, iris_app_build_utilities_1.getIrisAppWebpackDevServer)({}, options.devServerOptions),
|
|
45
46
|
resolve: {
|
|
46
47
|
extensions: [".tsx", ".ts", ".jsx", ".js", ".json"],
|
|
47
48
|
alias: await (0, iris_app_build_utilities_1.getAliasesFromTsConfig)({ nxRootDir }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultWebpackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/webpack/src/executors/utils/defaultWebpackConfig.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"defaultWebpackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/webpack/src/executors/utils/defaultWebpackConfig.ts"],"names":[],"mappings":";;;;AACA,kFAO6C;AAC7C,gFAAmF;AACnF,mDAA6B;AAC7B,yDAAmC;AACnC,8BAA4B;AAI5B,IAAI,oBAAoB,GAAyC,IAAI,CAAC;AACtE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ACE,IAAI,EAAE,aAAa;oBACnB,OAAO,EAAE,4BAA4B;oBACrC,GAAG,EAAE;wBACH,MAAM,EAAE,gBAAgB;wBACxB,OAAO,EAAE;4BACP,GAAG,EAAE,WAAW;4BAChB,MAAM,EAAE,KAAK;4BACb,MAAM,EAAE;gCACN,iCAAiC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;gCACrD,8BAA8B,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;6BACnD;yBACF;qBACF;iBACF;aACF;SACF;QAED,OAAO,EAAE;YACP,IAAI,OAAO,CAAC,SAAS,CAAC,sBAAsB,CAAC;gBAC3C,IAAI,EAAE,eAAe,CAAC,oBAAoB;gBAC1C,QAAQ,EAAE,gBAAgB;gBAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,CAAC,oBAAoB,EAAE;gBACvE,OAAO,EAAE,EAAE;gBACX,OAAO,EAAE,MAAM,IAAA,+CAAoB,EAAC;oBAClC,SAAS;oBACT,QAAQ,EAAE,eAAe;iBAC1B,CAAC;gBACF,MAAM,EAAE,IAAA,gDAAqB,EAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;aAC7D,CAAC;YAEF,IAAI,uDAA6B,CAAC;gBAChC,SAAS,EAAE,SAAS;gBACpB,MAAM;gBACN,QAAQ,EAAE,eAAe;aAC1B,CAAC;YACF,IAAI,iBAAiB,CAAC;gBACpB,QAAQ,EAAE,YAAY;aACvB,CAAC;YACF,oBAAoB;SACrB,CAAC,MAAM,CAAC,OAAO,CAAC;KAClB,CAAC;AACJ,CAAC,CAAC;AAjJW,QAAA,gBAAgB,oBAiJ3B","sourcesContent":["import { IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport {\n DevServerOptions,\n getAliasesFromTsConfig,\n getCopyPatterns,\n getExposedExtensions,\n getIrisAppWebpackDevServer,\n getSharedDependencies,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { TrackunitIrisAppWebpackPlugin } from \"@trackunit/iris-app-webpack-plugin\";\nimport * as path from \"path\";\nimport * as webpack from \"webpack\";\nimport \"webpack-dev-server\";\n\ntype WebpackConfiguration = webpack.Configuration;\n\nlet BundleAnalyzerPlugin: webpack.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// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\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 options additional configuration options\n * @returns { Promise<WebpackConfiguration> } the default webpack config\n */\nexport const getDefaultConfig = async (\n mode: \"production\" | \"development\",\n nxRootDir: string,\n appDir: string,\n irisAppManifest: IrisAppManifest,\n options: GetDefaultConfigOptions = {}\n): Promise<WebpackConfiguration> => {\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 return {\n mode: mode,\n output: {\n publicPath: \"auto\",\n path: path.join(nxRootDir, \"dist\", relativeAppDir),\n },\n\n entry: {},\n devtool: false,\n devServer: await getIrisAppWebpackDevServer({}, options.devServerOptions),\n resolve: {\n extensions: [\".tsx\", \".ts\", \".jsx\", \".js\", \".json\"],\n alias: await getAliasesFromTsConfig({ nxRootDir }),\n },\n module: {\n rules: [\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/resource\",\n generator: {\n filename: mode === \"production\" ? \"static/media/[hash][ext]\" : \"static/media/[name][ext]\",\n },\n },\n ],\n },\n {\n test: /\\.m?js/,\n type: \"javascript/auto\",\n resolve: {\n fullySpecified: false,\n },\n },\n {\n test: /\\.(png|jpe?g|gif|eot|ttf|ico|woff|woff2)$/,\n exclude: /(node_modules)/,\n type: \"asset/resource\",\n },\n {\n test: /\\.(png|jpe?g|gif|svg|eot|ttf|ico|woff|woff2)$/i,\n include: /(node_modules\\/@okta)/,\n type: \"asset/resource\",\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 test: /\\.json$/,\n loader: \"json-loader\",\n },\n {\n test: /\\.(j|t)sx?$/,\n exclude: /(vendor|node_modules|dist)/,\n use: {\n loader: \"esbuild-loader\",\n options: {\n jsx: \"automatic\",\n target: \"es6\",\n define: {\n \"process.env.IRIS_APP_SENTRY_DSN\": JSON.stringify(\"\"),\n \"process.env.IRIS_APP_VERSION\": JSON.stringify(\"\"),\n },\n },\n },\n },\n ],\n },\n\n plugins: [\n new webpack.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 CopyWebpackPlugin({\n patterns: copyPatterns,\n }),\n BundleAnalyzerPlugin,\n ].filter(Boolean),\n };\n};\n"]}
|