Skip to content

Commit

Permalink
Merge pull request #5 from chromaui/todd/ap-3472-pass-debug-webpack-t…
Browse files Browse the repository at this point in the history
…hrough-to-archive-sb-commands

Pass through args to Storybook commands
  • Loading branch information
tevanoff authored Sep 5, 2023
2 parents 73ab9a5 + 76b56a0 commit 8c4a7ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/bin/archive-storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import { execFileSync } from 'child_process';
import { resolve, dirname } from 'path';

// Discard first two entries (exec path and file path)
const args = process.argv.slice(2);

const configDir = 'node_modules/@chromaui/archive-storybook/config';
const binPath = resolve(dirname(require.resolve('@storybook/cli/package.json')), './bin/index.js');
execFileSync(binPath, ['dev', '-c', configDir], { stdio: 'inherit' });
execFileSync(binPath, ['dev', ...args, '-c', configDir], { stdio: 'inherit' });
5 changes: 4 additions & 1 deletion src/bin/build-archive-storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import { execFileSync } from 'child_process';
import { resolve, dirname } from 'path';

// Discard first two entries (exec path and file path)
const args = process.argv.slice(2);

const configDir = 'node_modules/@chromaui/archive-storybook/config';
const binPath = resolve(dirname(require.resolve('@storybook/cli/package.json')), './bin/index.js');
execFileSync(binPath, ['build', '-c', configDir], { stdio: 'inherit' });
execFileSync(binPath, ['build', ...args, '-c', configDir], { stdio: 'inherit' });

0 comments on commit 8c4a7ca

Please sign in to comment.