With Hydrogen, how to disable source map on production build?

Hello.

I’m working on a website with Hydrogen, and I wonder if it’s possible to disable to generate source maps on a production build.

I added an option in a vite.config.js file like this:

export default defineConfig(({mode}) => ({
......
  build: {
    sourcemap: mode !== 'production',
  },

// or just set false
  build: {
    sourcemap: false,
  },
......

Simply it’s not working, however.

How can I correct it?

Best Regards,

K