Skip to content

runInDebug() not stripped in production #18912

@mydea

Description

@mydea

I am using ember-source 3.18.0, and just noticed that runInDebug is not stripped from production builds.

This is my code:

import Route from '@ember/routing/route';
import { runInDebug } from '@ember/debug';

export default class ApplicationRoute extends Route {
  beforeModel() {
    runInDebug(() => {
      // do something
    });
    // ...
  }
}

I noticed on our CI that the build size increased whenever I added something inside of the runInDebug method. I then ran the build locally (ember b --prod) and checked the generated app.js file, and indeed the whole method with all the content was still there.

Note: It is not actually run it production, but the code is still in the bundle.

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