Skip to content

Function call disappear if there is a comment above it #79

@NeeEoo

Description

@NeeEoo
  • Operating System: Windows 10
  • Node Version: v10.9.0
  • NPM Version: 6.4.1
  • webpack Version: 4.29.6
  • terser-webpack-plugin Version: 1.2.3

Expected Behavior

The registerCmd function call should not disappear when there is a comment above it

Actual Behavior

The registerCmd function call disappears from the output

Code

/*registerCmd("cal", function(argv) { // Old code
   // ... 142 lines of private code
}, "cal - Shows a calendar")*/

registerCmd("cal", function(argv) { // New code
   // ... 154 lines of private code
}, "cal - Shows a calendar")
const TerserPlugin = require('terser-webpack-plugin');
// ...
new TerserPlugin({
    terserOptions: {
        mangle: true,
        output: {
            comments: /@license/i
        },
        ecma: 8,
        compress: {
            unsafe: true,
            sequences: true,
            passes: 5
        },
        parallel: true
    },
    parallel: true
})

How Do We Reproduce?

Cannot provide a repo because my project is closed source

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions