Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const disableTreeShake = (patterns: RegExp[]) => ({
});

export default defineConfig([{
tsconfig: 'tsconfig.lib.json',
input: 'src/index.ts',
output: {
file: '../../dist/apps/test-project/bundle/index.js',
Expand All @@ -31,6 +32,7 @@ exports[`bundle utilities > addTypeScriptBundleTarget > should not add disableTr
"import { defineConfig } from 'rolldown';

export default defineConfig([{
tsconfig: 'tsconfig.lib.json',
input: 'src/index.ts',
output: {
file: '../../dist/apps/test-project/bundle/index.js',
Expand Down
13 changes: 13 additions & 0 deletions packages/nx-plugin/src/utils/bundle/bundle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,19 @@ export default defineConfig([
expect(configContent).toContain('src/handler.ts');
});

it('should configure tsconfig', () => {
addTypeScriptBundleTarget(tree, project, {
targetFilePath: 'src/index.ts',
});

const configContent = tree.read(
'apps/test-project/rolldown.config.ts',
'utf-8',
);

expect(configContent).toContain("tsconfig: 'tsconfig.lib.json'");
});

it('should configure platform with default value of node', () => {
addTypeScriptBundleTarget(tree, project, {
targetFilePath: 'src/index.ts',
Expand Down
4 changes: 4 additions & 0 deletions packages/nx-plugin/src/utils/bundle/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ const disableTreeShake = (patterns: RegExp[]) => ({
...node.elements,
factory.createObjectLiteralExpression(
[
factory.createPropertyAssignment(
factory.createIdentifier('tsconfig'),
factory.createStringLiteral('tsconfig.lib.json', true),
),
factory.createPropertyAssignment(
factory.createIdentifier('input'),
factory.createStringLiteral(opts.targetFilePath, true),
Expand Down
Loading