| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #!/usr/bin/env node
- /**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- 'use strict';
- const webpack = require( 'webpack' );
- const tasks = require( '@ckeditor/ckeditor5-dev-bundler-rollup' );
- const config = require( '../build-config' );
- const getWebpackConfig = require( '../dev/getwebpackconfig' );
- const getWebpackEs6Config = require( '../dev/getwebpackes6config' );
- console.log( 'Creating an entry file...' );
- tasks.createEntryFile( '.', {
- plugins: config.plugins,
- moduleName: config.moduleName,
- editor: config.editor,
- config: config.editorConfig,
- } );
- const webpackEs6Config = getWebpackEs6Config( config.destinationPath, config.moduleName );
- const webpackConfig = getWebpackConfig( config.destinationPath, config.moduleName );
- Promise.all( [
- runWebpack( webpackEs6Config, 'ES6' ),
- runWebpack( webpackConfig, 'ES5' ),
- ] )
- .then( () => {
- console.log( 'Finished.' );
- } )
- .catch( ( err ) => {
- process.exitCode = -1;
- console.log( err );
- } );
- function runWebpack( webpackConfig, label ) {
- console.log( `Creating an ${ label } build...` );
- return new Promise( ( resolve, reject ) => {
- webpack( webpackConfig, ( err ) => {
- if ( err ) {
- return reject( err );
- }
- console.log( `The ${ label } build has been created.` );
- return resolve();
- } );
- } );
- }
|