Skip to content

use-babelrc missing debug options to show source map #471

@Vishwaas

Description

@Vishwaas

When we use on('file:preprocessor', require('@cypress/code-coverage/use-babelrc')) in the plugin/index.js file the source maps stop working. The source maps only show up if we have console.log in the tests.
Inside use-babelrc, we can see that browserify.defaultOptions has debug as undefined, so setting

const browserify = require('@cypress/browserify-preprocessor')

const options = browserify.defaultOptions
options.browserifyOptions.transform[1][1].babelrc = true
//adding the below line shows source map or else source map comes up only if console.log is added to a test file
options.browserifyOptions.debug = true
module.exports = browserify(options)

Related issue: cypress-io/cypress-browserify-preprocessor#88

Note: not using use-babelrc or not preprocessing i.e. not having the below line in plugin/index.js will show sourcemaps, enabling this line without adding .debug=true disables sourcemap
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'))

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