Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.pipe( stream.noop( ( file ) => {
const bundleConfig = docsUtils.getBundlerConfigFromSample( file.contents.toString( 'utf-8' ) );
bundleConfig.format = 'iife';
bundleConfig.path = file.path.match( /\/samples\/(.*)\.js$/ )[ 1 ];
const splitPath = bundleConfig.path.split( path.sep );
const packageName = splitPath[ 0 ];
// Clean the output paths.
return ckeditor5DevBundler.clean( bundleConfig )
// Then bundle a editor.
.then( () => ckeditor5DevBundler.generate( bundleConfig ) )
// Then copy created files.
.then( () => {
const beginPath = splitPath.slice( 1, -1 ).join( path.sep ) || '.';
const fileName = splitPath.slice( -1 ).join();
const builtEditorPath = path.join( bundleDir, bundleConfig.path, bundleConfig.moduleName );
const destinationPath = path.join.apply( null, [