Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable sourcemaps in Vue-Vite

Is it possible to enable sourcemaps in Vue-Vite in production environment?

I would like to use it for Bugsnag.

Can't find anything about it in the docs.

In dev it just works out of the box.

like image 408
ndberg Avatar asked Sep 01 '25 00:09

ndberg


1 Answers

Thanks to @tony19 I could find it out:

Since vue ~2.0 it works like this:

In <projectRoot>/vite.config.js:

/**
* @type {import('vite').UserConfig}
*/
export default {
    plugins: [vue()],
    build: {
        sourcemap: true,
    },
}
like image 70
ndberg Avatar answered Sep 03 '25 02:09

ndberg