Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/drop-lodash-get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/typescript': patch
---

chore(typescript): drop `lodash.get` dependency in favor of optional chaining in `normalizeOptions`.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
"express": "5.2.1",
"fast-glob": "3.3.3",
"glob": "^11.0.0",
"lodash.get": "4.4.2",
"openai": "^6.27.0",
"rambda": "11.1.0",
"regenerator-runtime": "0.14.1",
Expand Down Expand Up @@ -222,7 +221,6 @@
"@types/fs-extra": "9.0.13",
"@types/jest": "29.5.13",
"@types/lodash.clonedeepwith": "^4.5.9",
"@types/lodash.get": "4.4.9",
"@types/minimatch": "^5.1.2",
"@types/node": "20.19.5",
"@types/node-fetch": "2.6.11",
Expand Down
1 change: 0 additions & 1 deletion packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
},
"dependencies": {
"axios": "1.15.0",
"lodash.get": "4.4.2",
"node-fetch": "2.7.0",
"tapable": "2.3.0"
},
Expand Down
10 changes: 7 additions & 3 deletions packages/typescript/src/lib/normalizeOptions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import ts from 'typescript';
import { Compiler } from 'webpack';
import get from 'lodash.get';
import path from 'path';

import type { FederatedTypesPluginOptions, TypeServeOptions } from '../types';
Expand Down Expand Up @@ -80,9 +79,14 @@ export const normalizeOptions = (

const federationFileName = (federationConfig.filename ??
'remoteEntry.js') as string;
const devServer = (
webpackCompilerOptions as {
devServer?: { static?: { directory?: string } };
}
).devServer;
const distPath =
get(webpackCompilerOptions, 'devServer.static.directory') ||
get(webpackCompilerOptions, 'output.path') ||
devServer?.static?.directory ||
webpackCompilerOptions.output?.path ||
'dist';

const typesPath = federationFileName.substring(
Expand Down
22 changes: 0 additions & 22 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading