@steroidsjs/ckeditor5
Version:
The development environment of CKEditor 5 ā the best browser-based rich text editor.
60 lines (44 loc) ⢠1.79 kB
JavaScript
#!/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'
} );