UNPKG

@steroidsjs/ckeditor5

Version:

The development environment of CKEditor 5 – the best browser-based rich text editor.

60 lines (44 loc) • 1.79 kB
#!/usr/bin/env node /** * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ /* eslint-env node */ const childProcess = require( 'child_process' ); const path = require( 'path' ); const chalk = require( 'chalk' ); const ROOT_DIRECTORY = path.resolve( __dirname, '..', '..' ); const IS_DEVELOPMENT_MODE = process.argv.includes( '--dev' ); if ( IS_DEVELOPMENT_MODE ) { console.log( 'šŸ› ļøļø ' + chalk.yellow( 'Development mode is active.' ) ); } else { console.log( 'āš ļø ' + chalk.magenta( 'Production mode is active. Use --dev to build in the development mode.' ) ); } // ------------------------------------------------------------- // ------------------------------------------- Base DLL build -- console.log( '\nšŸ“ ' + chalk.cyan.underline( 'Creating the base DLL build...\n' ) ); const webpackArguments = [ '--config=./scripts/dll/webpack.config.dll.js' ]; if ( IS_DEVELOPMENT_MODE ) { webpackArguments.push( '--dev' ); } childProcess.spawnSync( 'webpack', webpackArguments, { encoding: 'utf8', shell: true, cwd: ROOT_DIRECTORY, stdio: 'inherit', stderr: 'inherit' } ); // ------------------------------------------------------------- // ---------------------------- DLL-compatible package builds -- console.log( '\nšŸ“ ' + chalk.underline( 'Creating DLL-compatible package builds...\n' ) ); const nodeArguments = [ './scripts/dll/build-packages-dlls.js' ]; if ( IS_DEVELOPMENT_MODE ) { nodeArguments.push( '--dev' ); } childProcess.spawnSync( 'node', nodeArguments, { encoding: 'utf8', shell: true, cwd: ROOT_DIRECTORY, stdio: 'inherit', stderr: 'inherit' } );