@trackunit/iris-app-sdk-rspack 1.7.50 → 1.7.52
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 +18 -0
- package/package.json +7 -6
- package/src/executors/utils/defaultRspackConfig.d.ts +9 -0
- package/src/executors/utils/defaultRspackConfig.js +27 -1
- package/src/executors/utils/defaultRspackConfig.js.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## 1.7.52 (2025-11-04)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated iris-app-build-utilities to 1.7.50
|
|
6
|
+
- Updated iris-app-webpack-plugin to 1.7.51
|
|
7
|
+
- Updated iris-app-api to 1.7.50
|
|
8
|
+
- Updated shared-utils to 1.9.48
|
|
9
|
+
|
|
10
|
+
## 1.7.51 (2025-11-03)
|
|
11
|
+
|
|
12
|
+
### 🧱 Updated Dependencies
|
|
13
|
+
|
|
14
|
+
- Updated iris-app-build-utilities to 1.7.49
|
|
15
|
+
- Updated iris-app-webpack-plugin to 1.7.50
|
|
16
|
+
- Updated iris-app-api to 1.7.49
|
|
17
|
+
- Updated shared-utils to 1.9.47
|
|
18
|
+
|
|
1
19
|
## 1.7.50 (2025-11-03)
|
|
2
20
|
|
|
3
21
|
### 🧱 Updated Dependencies
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app-sdk-rspack",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.52",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"executors": "./executors.json",
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
"pacote": "17.0.6",
|
|
17
17
|
"semver": "7.5.4",
|
|
18
18
|
"webpack-bundle-analyzer": "^4.8.0",
|
|
19
|
-
"@trackunit/iris-app-build-utilities": "1.7.
|
|
20
|
-
"@trackunit/shared-utils": "1.9.
|
|
21
|
-
"@trackunit/iris-app-api": "1.7.
|
|
22
|
-
"@trackunit/iris-app-webpack-plugin": "1.7.
|
|
23
|
-
"tslib": "^2.6.2"
|
|
19
|
+
"@trackunit/iris-app-build-utilities": "1.7.50",
|
|
20
|
+
"@trackunit/shared-utils": "1.9.48",
|
|
21
|
+
"@trackunit/iris-app-api": "1.7.50",
|
|
22
|
+
"@trackunit/iris-app-webpack-plugin": "1.7.51",
|
|
23
|
+
"tslib": "^2.6.2",
|
|
24
|
+
"ts-checker-rspack-plugin": "^1.1.1"
|
|
24
25
|
},
|
|
25
26
|
"types": "./src/index.d.ts",
|
|
26
27
|
"main": "./src/index.js",
|
|
@@ -12,4 +12,13 @@ type RspackConfiguration = rspack.Configuration;
|
|
|
12
12
|
* @returns { Promise<RspackConfiguration> } the default webpack config
|
|
13
13
|
*/
|
|
14
14
|
export declare const getDefaultConfig: (mode: "production" | "development", nxRootDir: string, appDir: string, irisAppManifest: IrisAppManifest, context: ExecutorContext) => Promise<RspackConfiguration>;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the configuration for internal apps by removing the TypeScript checker plugin.
|
|
17
|
+
* Internal apps in this repo should use this function to disable the default TypeScript checking
|
|
18
|
+
* that is included in the base rspack configuration.
|
|
19
|
+
*
|
|
20
|
+
* @param configuration - The rspack configuration
|
|
21
|
+
* @returns { RspackConfiguration } The configuration without TsCheckerRspackPlugin
|
|
22
|
+
*/
|
|
23
|
+
export declare const getConfigWithoutTsChecker: (configuration: RspackConfiguration) => RspackConfiguration;
|
|
15
24
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultConfig = void 0;
|
|
3
|
+
exports.getConfigWithoutTsChecker = exports.getDefaultConfig = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const rspack = tslib_1.__importStar(require("@rspack/core"));
|
|
6
6
|
const iris_app_api_1 = require("@trackunit/iris-app-api");
|
|
@@ -8,6 +8,7 @@ const iris_app_build_utilities_1 = require("@trackunit/iris-app-build-utilities"
|
|
|
8
8
|
const iris_app_webpack_plugin_1 = require("@trackunit/iris-app-webpack-plugin");
|
|
9
9
|
const shared_utils_1 = require("@trackunit/shared-utils");
|
|
10
10
|
const path = tslib_1.__importStar(require("path"));
|
|
11
|
+
const ts_checker_rspack_plugin_1 = require("ts-checker-rspack-plugin");
|
|
11
12
|
let BundleAnalyzerPlugin = null;
|
|
12
13
|
if (process.env.BUNDLE_ANALYSE === "true") {
|
|
13
14
|
// doing require here to avoid dependency on webpack-bundle-analyzer directly
|
|
@@ -240,6 +241,12 @@ const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest, contex
|
|
|
240
241
|
new rspack.CopyRspackPlugin({
|
|
241
242
|
patterns: copyPatterns,
|
|
242
243
|
}),
|
|
244
|
+
new ts_checker_rspack_plugin_1.TsCheckerRspackPlugin({
|
|
245
|
+
async: true,
|
|
246
|
+
typescript: {
|
|
247
|
+
configFile: path.join(appDir, "tsconfig.json"),
|
|
248
|
+
},
|
|
249
|
+
}),
|
|
243
250
|
BundleAnalyzerPlugin,
|
|
244
251
|
].filter(Boolean),
|
|
245
252
|
};
|
|
@@ -247,4 +254,23 @@ const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest, contex
|
|
|
247
254
|
return await combinedConfig({});
|
|
248
255
|
};
|
|
249
256
|
exports.getDefaultConfig = getDefaultConfig;
|
|
257
|
+
/**
|
|
258
|
+
* Gets the configuration for internal apps by removing the TypeScript checker plugin.
|
|
259
|
+
* Internal apps in this repo should use this function to disable the default TypeScript checking
|
|
260
|
+
* that is included in the base rspack configuration.
|
|
261
|
+
*
|
|
262
|
+
* @param configuration - The rspack configuration
|
|
263
|
+
* @returns { RspackConfiguration } The configuration without TsCheckerRspackPlugin
|
|
264
|
+
*/
|
|
265
|
+
const getConfigWithoutTsChecker = (configuration) => {
|
|
266
|
+
const existingPlugins = configuration.plugins || [];
|
|
267
|
+
return {
|
|
268
|
+
...configuration,
|
|
269
|
+
plugins: existingPlugins.filter(plugin => {
|
|
270
|
+
const pluginName = plugin?.constructor.name;
|
|
271
|
+
return pluginName !== "TsCheckerRspackPlugin";
|
|
272
|
+
}),
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
exports.getConfigWithoutTsChecker = getConfigWithoutTsChecker;
|
|
250
276
|
//# sourceMappingURL=defaultRspackConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultRspackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/utils/defaultRspackConfig.ts"],"names":[],"mappings":";;;;AACA,6DAAuC;AACvC,0DAAiH;AACjH,kFAK6C;AAC7C,gFAAmF;AACnF,0DAAiD;AACjD,mDAA6B;AAI7B,IAAI,oBAAoB,GAAwC,IAAI,CAAC;AACrE,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;IAC1C,6EAA6E;IAC7E,iEAAiE;IACjE,MAAM,+BAA+B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC,oBAAoB,CAAC;IAChG,oBAAoB,GAAG,IAAI,+BAA+B,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;AACzF,CAAC;AAED;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAG,KAAK,EACnC,IAAkC,EAClC,SAAiB,EACjB,MAAc,EACd,eAAgC,EAChC,OAAwB,EACM,EAAE;IAChC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC;IACxE,MAAM,SAAS,GAAG,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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,oBAAoB;aACrB,CAAC,MAAM,CAAC,OAAO,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC;AA5OW,QAAA,gBAAgB,oBA4O3B","sourcesContent":["import { ExecutorContext } from \"@nx/devkit\";\nimport * as rspack from \"@rspack/core\";\nimport { IrisAppManifest, isIconByPath, isImageByPath, serverSideExtensionTypes } from \"@trackunit/iris-app-api\";\nimport {\n getAliasesFromTsConfig,\n getExposedExtensions,\n getIrisAppWebpackDevServer,\n getSharedDependencies,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { TrackunitIrisAppWebpackPlugin } from \"@trackunit/iris-app-webpack-plugin\";\nimport { truthy } from \"@trackunit/shared-utils\";\nimport * as path from \"path\";\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 const iconPaths = irisAppManifest.extensions\n .map(extension => {\n if (extension.type === \"FLEET_EXTENSION\" && extension.menuItem.image && isIconByPath(extension.menuItem.image)) {\n return {\n extensionId: extension.id,\n path: extension.menuItem.image.path,\n sourceRoot: extension.sourceRoot,\n };\n }\n return null;\n })\n .filter(truthy);\n const widgetIconPaths = irisAppManifest.extensions.flatMap(extension => {\n const paths = [];\n if (\n extension.type === \"WIDGET_EXTENSION\" &&\n extension.footer?.poweredByImage &&\n isImageByPath(extension.footer.poweredByImage)\n ) {\n paths.push({\n extensionId: extension.id,\n path: extension.footer.poweredByImage.path,\n sourceRoot: extension.sourceRoot,\n });\n }\n if (extension.type === \"WIDGET_EXTENSION\" && extension.header.image && isIconByPath(extension.header.image)) {\n paths.push({\n extensionId: extension.id,\n path: extension.header.image.path,\n sourceRoot: extension.sourceRoot,\n });\n }\n\n return paths;\n });\n\n const copyPatterns = [\n ...irisAppManifest.extensions\n .filter(extension => mode === \"production\" && serverSideExtensionTypes.includes(extension.type))\n .flatMap(extension => {\n const patterns: Array<{ from: string; to: string }> = [\n {\n //globs must use / in path to be valid\n from: path.resolve(nxRootDir, extension.sourceRoot.replace(/\\\\/g, \"/\")),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, \"serverside\", extension.id),\n },\n ];\n\n // Check if extension has dependencyDefinitionFile and add it to patterns if it exists\n if (\"dependencyDefinitionFile\" in extension && extension.dependencyDefinitionFile) {\n patterns.push({\n //globs must use / in path to be valid\n from: path.resolve(nxRootDir, extension.dependencyDefinitionFile.replace(/\\\\/g, \"/\")),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, \"serverside\", extension.id),\n });\n }\n\n return patterns;\n }),\n {\n //globs must use / in path to be valid\n from: path.join(appDir, \"assets/\").replace(/\\\\/g, \"/\"),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, \"assets\"),\n },\n ...[...iconPaths, ...widgetIconPaths].map(iconPath => ({\n //globs must use / in path to be valid\n from: path.join(nxRootDir, iconPath.sourceRoot, iconPath.path).replace(/\\\\/g, \"/\"),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, iconPath.extensionId, iconPath.path),\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 getIrisAppWebpackDevServer(),\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: await 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 BundleAnalyzerPlugin,\n ].filter(Boolean),\n };\n };\n\n return await combinedConfig({});\n};\n"]}
|
|
1
|
+
{"version":3,"file":"defaultRspackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/utils/defaultRspackConfig.ts"],"names":[],"mappings":";;;;AACA,6DAAuC;AACvC,0DAAiH;AACjH,kFAK6C;AAC7C,gFAAmF;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C,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, isIconByPath, isImageByPath, serverSideExtensionTypes } from \"@trackunit/iris-app-api\";\nimport {\n getAliasesFromTsConfig,\n getExposedExtensions,\n getIrisAppWebpackDevServer,\n getSharedDependencies,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { TrackunitIrisAppWebpackPlugin } from \"@trackunit/iris-app-webpack-plugin\";\nimport { truthy } from \"@trackunit/shared-utils\";\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 const iconPaths = irisAppManifest.extensions\n .map(extension => {\n if (extension.type === \"FLEET_EXTENSION\" && extension.menuItem.image && isIconByPath(extension.menuItem.image)) {\n return {\n extensionId: extension.id,\n path: extension.menuItem.image.path,\n sourceRoot: extension.sourceRoot,\n };\n }\n return null;\n })\n .filter(truthy);\n const widgetIconPaths = irisAppManifest.extensions.flatMap(extension => {\n const paths = [];\n if (\n extension.type === \"WIDGET_EXTENSION\" &&\n extension.footer?.poweredByImage &&\n isImageByPath(extension.footer.poweredByImage)\n ) {\n paths.push({\n extensionId: extension.id,\n path: extension.footer.poweredByImage.path,\n sourceRoot: extension.sourceRoot,\n });\n }\n if (extension.type === \"WIDGET_EXTENSION\" && extension.header.image && isIconByPath(extension.header.image)) {\n paths.push({\n extensionId: extension.id,\n path: extension.header.image.path,\n sourceRoot: extension.sourceRoot,\n });\n }\n\n return paths;\n });\n\n const copyPatterns = [\n ...irisAppManifest.extensions\n .filter(extension => mode === \"production\" && serverSideExtensionTypes.includes(extension.type))\n .flatMap(extension => {\n const patterns: Array<{ from: string; to: string }> = [\n {\n //globs must use / in path to be valid\n from: path.resolve(nxRootDir, extension.sourceRoot.replace(/\\\\/g, \"/\")),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, \"serverside\", extension.id),\n },\n ];\n\n // Check if extension has dependencyDefinitionFile and add it to patterns if it exists\n if (\"dependencyDefinitionFile\" in extension && extension.dependencyDefinitionFile) {\n patterns.push({\n //globs must use / in path to be valid\n from: path.resolve(nxRootDir, extension.dependencyDefinitionFile.replace(/\\\\/g, \"/\")),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, \"serverside\", extension.id),\n });\n }\n\n return patterns;\n }),\n {\n //globs must use / in path to be valid\n from: path.join(appDir, \"assets/\").replace(/\\\\/g, \"/\"),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, \"assets\"),\n },\n ...[...iconPaths, ...widgetIconPaths].map(iconPath => ({\n //globs must use / in path to be valid\n from: path.join(nxRootDir, iconPath.sourceRoot, iconPath.path).replace(/\\\\/g, \"/\"),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, iconPath.extensionId, iconPath.path),\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 getIrisAppWebpackDevServer(),\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: await 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"]}
|
package/src/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getConfigWithoutTsChecker } from "./executors/utils/defaultRspackConfig";
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConfigWithoutTsChecker = void 0;
|
|
4
|
+
var defaultRspackConfig_1 = require("./executors/utils/defaultRspackConfig");
|
|
5
|
+
Object.defineProperty(exports, "getConfigWithoutTsChecker", { enumerable: true, get: function () { return defaultRspackConfig_1.getConfigWithoutTsChecker; } });
|
|
2
6
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/rspack/src/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/rspack/src/index.ts"],"names":[],"mappings":";;;AAAA,6EAAkF;AAAzE,gIAAA,yBAAyB,OAAA","sourcesContent":["export { getConfigWithoutTsChecker } from \"./executors/utils/defaultRspackConfig\";\n"]}
|