terser-webpack-plugin: webpack build freezing when using terser

Sorry for not following the template, but I don’t have all the information. @StefanSchoof will come and complete the issue and I’ll edit in the information.

Expected Behavior

The build should finish.

Actual Behavior

Webpack freezes for at least 60 minutes (the build times out).

Code

switch.js:

"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const msRestAzure = __importStar(require("ms-rest-azure"));
const azure_keyvault_1 = require("azure-keyvault");
async function getConnectionString() {
    const cred = msRestAzure.loginWithAppServiceMSI({ resource: 'https://vault.azure.net' });
    const client = new azure_keyvault_1.KeyVaultClient(await cred);
    const secret = await client.getSecret(process.env.KEYVAULT_URI, 'iotHubConnectionString', '');
    return secret.value;
}
exports.getConnectionString = getConnectionString;

webpack config:

const path = require('path');

module.exports = {
    mode: 'production',
    target: 'node',
    entry: {
        'switch': './switch.js'
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: '[name]/[name].js',
        libraryTarget: 'commonjs2'
    },
    resolve: {
        extensions: ['.ts', '.js', '.json'],
        modules: [
            'node_modules',
            'src'
        ]
    },
}

How Do We Reproduce?

run NODE_ENV=production webpack with the above config and entry file

⛄ original issue link here

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (11 by maintainers)

Most upvoted comments

I think yea. I like to hear from @fabiosantoscode if he see things the same.