@gravityforms/gulp-tasks
Version:
Configurable Gulp tasks for use in Gravity Forms projects.
27 lines (21 loc) • 896 B
JavaScript
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { execShellCommand } from './util.js';
const __dirname = path.dirname( fileURLToPath( import.meta.url ) );
const packagesDir = path.resolve( __dirname, '../../../' );
const storybooksPath = path.join( packagesDir, 'storybooks' );
async function init() {
await execShellCommand( `cd "${ storybooksPath }" && npm run export:components`, true );
await execShellCommand( 'node ./src/scripts/libraries-dist.js', true );
await execShellCommand( 'node ./src/scripts/react-utils-dist.js', true );
await execShellCommand( 'node ./src/scripts/utils-dist.js', true );
await execShellCommand( 'node ./src/scripts/components-dist.js', true );
}
( async () => {
try {
await init();
} catch ( err ) {
console.error( 'An error occurred while generating all package dist files: ', err );
}
} )();