lib/dev.js
function bundleHandler (pathToHandlers, module, file) {

    // only rebundle if js file changed
    if (file.length < 3 || file.indexOf('bundle.') === 0 || file.substr(file.length - 3) !== '.js') {
        return;
    }

    // only rebundle if handler was already bundled before
    fs.access(pathToHandlers + '/bundle.' + file, err => {

        if (err && err.code === 'ENOENT') {
            return ;
        }

        let fnIri = module + '/' + file.slice(0, -3);

        // remove the old bundle
        fs.unlink(pathToHandlers + '/bundle.' + file, err => {

            if (err) {
                console.log('Failed to delete old bundle for handler: ' + fnIri);
                return console.log(err);
            }

            // build the new bundle
            console.log('Bundle handler: ' + fnIri);
            runtime.bundle(fnIri, {}, (err) => {

                if (err) {
                    console.log('Failed to bundle handler: ' + fnIri);
                    return console.log(err);
                }

                console.log('Bundle done for handler: ' + fnIri);
            });
        });
    });
}
function bundleHandler (pathToHandlers, module, file) {

    // only rebundle if js file changed
    if (file.length < 3 || file.indexOf('bundle.') === 0 || file.substr(file.length - 3) !== '.js') {
        return;
    }

    // only rebundle if handler was already bundled before
    fs.access(pathToHandlers + '/bundle.' + file, err => {

        if (err && err.code === 'ENOENT') {
            return ;
        }

        let fnIri = module + '/' + file.slice(0, -3);

        // remove the old bundle
        fs.unlink(pathToHandlers + '/bundle.' + file, err => {

            if (err) {
                console.log('Failed to delete old bundle for handler: ' + fnIri);
                return console.log(err);
            }

            // build the new bundle
            console.log('Bundle handler: ' + fnIri);
            runtime.bundle(fnIri, {}, (err) => {

                if (err) {
                    console.log('Failed to bundle handler: ' + fnIri);
                    return console.log(err);
                }

                console.log('Bundle done for handler: ' + fnIri);
            });
        });
    });
}
function bundleHandler ( pathToHandlers , module , file ) { // only rebundle if js file changed if ( file . length < 3 || file . indexOf ( 'bundle.' ) === 0 || file . substr ( file . length - 3 ) !== '.js' ) { return ; } // only rebundle if handler was already bundled before fs . access ( pathToHandlers + '/bundle.' + file , err => { if ( err && err . code === 'ENOENT' ) { return ; } let fnIri = module + '/' + file . slice ( 0 , - 3 ) ; // remove the old bundle fs . unlink ( pathToHandlers + '/bundle.' + file , err => { if ( err ) { console . log ( 'Failed to delete old bundle for handler: ' + fnIri ) ; return console . log ( err ) ; } // build the new bundle console . log ( 'Bundle handler: ' + fnIri ) ; runtime . bundle ( fnIri , { } , ( err ) => { if ( err ) { console . log ( 'Failed to bundle handler: ' + fnIri ) ; return console . log ( err ) ; } console . log ( 'Bundle done for handler: ' + fnIri ) ; } ) ; } ) ; } ) ; }
this will rebundle a handler
this will rebundle a handler