Make it more conveignent to run storybook
This commit is contained in:
19
scripts/build-storybook.ts
Normal file
19
scripts/build-storybook.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import * as child_process from "child_process";
|
||||
import { join } from "path";
|
||||
|
||||
run("yarn build");
|
||||
|
||||
run(`node ${join("dist", "bin", "main.js")} copy-keycloak-resources-to-public`, {
|
||||
env: {
|
||||
...process.env,
|
||||
PUBLIC_DIR_PATH: join(".storybook", "static")
|
||||
}
|
||||
});
|
||||
|
||||
run("npx build-storybook");
|
||||
|
||||
function run(command: string, options?: { env?: NodeJS.ProcessEnv }) {
|
||||
console.log(`$ ${command}`);
|
||||
|
||||
child_process.execSync(command, { stdio: "inherit", ...options });
|
||||
}
|
Reference in New Issue
Block a user