Skip to content

Commit

Permalink
Use a separate tsup config for the action
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Jun 7, 2023
1 parent c6fa415 commit 2989d0d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ outputs:
description: 'The number of inherited (not captured) snapshots (e.g. due to TurboSnap)'

runs:
main: dist/action.js
main: action/register.js
using: node16
47 changes: 30 additions & 17 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
import { defineConfig } from 'tsup';

export default defineConfig((options) => ({
entry: {
action: 'action-src/register.js',
bin: 'bin-src/register.js',
node: 'node-src/index.ts',
export default defineConfig((options) => [
{
entry: {
bin: 'bin-src/register.js',
node: 'node-src/index.ts',
},
splitting: true,
minify: !options.watch,
format: ['cjs'],
dts: {
entry: ['node-src/index.ts'],
resolve: true,
},
treeshake: true,
sourcemap: false,
clean: true,
platform: 'node',
target: 'node16',
},
splitting: false,
minify: !options.watch,
format: ['cjs'],
dts: {
entry: ['node-src/index.ts'],
resolve: true,
{
entry: ['action-src/register.js'],
outDir: 'action',
splitting: false,
minify: !options.watch,
format: ['cjs'],
treeshake: true,
sourcemap: false,
clean: true,
platform: 'node',
target: 'node16',
},
treeshake: true,
sourcemap: false,
clean: true,
platform: 'node',
target: 'node16',
}));
]);

0 comments on commit 2989d0d

Please sign in to comment.