Skip to content

Commit

Permalink
fix: tsup config join (#2465)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilteoood authored May 7, 2024
1 parent a05cfcb commit 677958c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .changeset/two-files-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@module-federation/native-federation-typescript': patch
'@module-federation/third-party-dts-extractor': patch
'@module-federation/native-federation-tests': patch
'@module-federation/dts-plugin': patch
---

fix: tsup configuration
27 changes: 19 additions & 8 deletions packages/dts-plugin/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Options } from 'tsup';
import { join } from 'path';
import type { Options } from 'tsup';

function generateConfigurations(
options: Array<[string[] | Record<string, string>, Options]>,
Expand All @@ -11,7 +11,7 @@ function generateConfigurations(
clean: true,
dts: true,
legacyOutput: true,
outDir: 'packages/dts-plugin/dist',
outDir: join('packages', 'dts-plugin', 'dist'),
external: [join(__dirname, 'package.json')],
...config,
};
Expand All @@ -21,19 +21,30 @@ function generateConfigurations(
export const tsup: Options[] = generateConfigurations([
[
{
index: join(__dirname, 'src/index.ts'),
core: join(__dirname, 'src/core/index.ts'),
forkDevWorker: join(__dirname, 'src/dev-worker/forkDevWorker.ts'),
startBroker: join(__dirname, 'src/server/broker/startBroker.ts'),
forkGenerateDts: join(__dirname, 'src/core/lib/forkGenerateDts.ts'),
index: join(__dirname, 'src', 'index.ts'),
core: join(__dirname, 'src', 'core', 'index.ts'),
forkDevWorker: join(__dirname, 'src', 'dev-worker', 'forkDevWorker.ts'),
startBroker: join(__dirname, 'src', 'server', 'broker', 'startBroker.ts'),
forkGenerateDts: join(
__dirname,
'src',
'core',
'lib',
'forkGenerateDts.ts',
),
},
{
format: ['cjs'],
},
],
[
{
'launch-web-client': join(__dirname, 'src/server/launchWebClient.ts'),
'launch-web-client': join(
__dirname,
'src',
'server',
'launchWebClient.ts',
),
},
{
format: ['iife'],
Expand Down
2 changes: 1 addition & 1 deletion packages/native-federation-tests/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default defineConfig({
clean: true,
minify: true,
format: ['cjs', 'esm'],
outDir: 'packages/native-federation-tests/dist',
outDir: join('packages', 'native-federation-tests', 'dist'),
external: [join(__dirname, 'package.json')],
});
2 changes: 1 addition & 1 deletion packages/native-federation-typescript/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default defineConfig({
clean: true,
minify: true,
format: ['cjs', 'esm'],
outDir: 'packages/native-federation-typescript/dist',
outDir: join('packages', 'native-federation-typescript', 'dist'),
external: [join(__dirname, 'package.json')],
});
2 changes: 1 addition & 1 deletion packages/third-party-dts-extractor/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export default defineConfig({
splitting: true,
clean: true,
format: ['cjs', 'esm'],
outDir: 'packages/third-party-dts-extractor/dist',
outDir: join('packages', 'third-party-dts-extractor', 'dist'),
external: [join(__dirname, 'package.json')],
});

0 comments on commit 677958c

Please sign in to comment.