Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Consider disable optimization so debugger statements are not stripped #29

@Strajk

Description

@Strajk
  • Cypress Version: 3.1.0
  • Package Version: 3.0.0

Is this a Feature or Bug?

Not expected behavior

Current behavior:

debugger statements are stripped from tests with default settings of cypress-webpack-preprocessor

Desired behavior:

Should not be stipped or at least it should be very well documented

How to reproduce:

Cypress.on("fail", (err, runnable) => {
  console.log("I'm here!!!")
  debugger // eslint-disable-line no-debugger
  return err
})

is compiled to

Cypress.on("fail", function(e, t) {
  return console.log("I'm here!!!"),
  e
}),

adding

const options = webpack.defaultOptions
  options.webpackOptions.optimization = { minimize: false } // THIS!
  on("file:preprocessor", webpack(options))

will not strip the debugger


I can submit PR if you will agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions