# Removing debug messages from build bundle (Vite)

**URL:** <https://discourse.aurelia.io/t/removing-debug-messages-from-build-bundle-vite/5540>\
**Category:** vNext\
**Created:** [September 20, 2024, 9:03am UTC](https://discourse.aurelia.io/t/removing-debug-messages-from-build-bundle-vite/5540 "2024-09-20T09:03:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivan](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ivan/32/2022_2.png) [@ivan](https://discourse.aurelia.io/u/ivan)\
**Post date:** [September 20, 2024, 9:03am UTC](https://discourse.aurelia.io/t/removing-debug-messages-from-build-bundle-vite/5540/1 "2024-09-20T09:03:29Z")

</div>

Looking at this file

> <https://github.com/aurelia/aurelia/blob/c5dfca356050840cc36f68d212803db52bd71c84/packages/router-lite/src/events.ts#L224>

we can see that a lot of event messages are defined, which is great during development. However, when building the app using Vite, I can see that they are also included in the final build. IS there anyway to remove them to make the bundle size a bit smaller? Or is it not worth the hassle?

The generated bundle looks something like this:

```auto
...
3156:"The given context is a custom element viewmodel (name:%s); resolving RouteContext from controller's RenderContext",3157:"The given context is a custom element controller (name:%s); resolving RouteContext from controller's RenderContext",3158:"Resolving viewport agent for the request: %s",3159:"Creating component agent for the node: %s",3160:"Registering viewport: %s",3161:"Skipping registering viewport: %s; it is already registered",3162:"Unregistering viewport: %s",3163:"Skipping unregistering viewport: %s; it is not registered",3164:"Recognizing path: %s",3165:"Adding route: %s",3166:"Unable to eagerly generate path for %s; reasons: %s",3167:"The provided container has no registered IAppRoot. RouteContext.setRoot can only be used after Aurelia.app was called, on a container that is within that app's component tree.",3168:'A root RouteContext is already registered. A possible cause is the RouterConfiguration being registered more than once in the same container tree. If you have a multi-rooted app, make sure you register RouterConfiguration only in the "forked" containers and not in the common root.',3169:"The provided IAppRoot does not (yet) have a controller. A possible cause is calling this API manually before Aurelia.start() is called",3170:"Invalid context type: %s",3171:"Invariant violation: RouteNode should be set immediately after the RouteContext is created. Context: %s",3172:"RouteContext has no ViewportAgent: %s",3173:"Invalid route config. When the component property is a lazy import, the path must be specified.",3174:`Failed to resolve %s at:

```

Any ideas?

Maybe something similar to the way purgecss works?
