<commit_before>'use strict';

const BbPromise = require('bluebird');
const webpack = require('webpack');
const fs = require('fs');
const path = require('path');
const npm = require('npm-programmatic');

module.exports = {
  packExternalModules() {
    
    this.serverless.cli.log(this.webpackOutputPath);

    this.serverless.cli.log(JSON.stringify(this.webpackConfig.externals));

    const externals = this.webpackConfig.externals;

    return BbPromise.resolve().then(() => {
        if (!externals || externals.length === 0) {
            return;
        }
       
        this.serverless.cli.log('packing external modules');

        const tmpPackageJson = path.join(this.webpackOutputPath, 'package.json'); 
    
        // create a temp package.json in dist directory so that we can install the dependencies later.
        fs.writeFileSync(tmpPackageJson, "{}");

        return new BbPromise((resolve, reject) => {
            npm.install(externals, {
                cwd: this.webpackOutputPath,
                save: false
            }).then(() => {
                fs.unlink(tmpPackageJson);
                resolve()
            }).catch(e => {
                fs.unlink(tmpPackageJson);
                reject(e);
            })
        })
    })
  },
};
<commit_msg>removed the debugging output<commit_after>'use strict';

const BbPromise = require('bluebird');
const webpack = require('webpack');
const fs = require('fs');
const path = require('path');
const npm = require('npm-programmatic');

module.exports = {
  packExternalModules() {

    const externals = this.webpackConfig.externals;

    return BbPromise.resolve().then(() => {
        if (!externals || externals.length === 0) {
            return;
        }
       
        this.serverless.cli.log('packing external modules');

        const tmpPackageJson = path.join(this.webpackOutputPath, 'package.json'); 
    
        // create a temp package.json in dist directory so that we can install the dependencies later.
        fs.writeFileSync(tmpPackageJson, "{}");

        return new BbPromise((resolve, reject) => {
            npm.install(externals, {
                cwd: this.webpackOutputPath,
                save: false
            }).then(() => {
                fs.unlink(tmpPackageJson);
                resolve()
            }).catch(e => {
                fs.unlink(tmpPackageJson);
                reject(e);
            })
        })
    })
  },
};

{'fraction_non_alphanumeric': 0.13333333333333333, 'fraction_numerical': 0.0008179959100204499, 'mean_word_length': 2.1198979591836733, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5294016', 'n_tokens_mistral': 689, 'n_tokens_neox': 652, 'n_words': 139}