I haven't use preact before. tried a working method with react. seems it's not working with preact.
The correct way to do this w/ Preact-CLI is to create (or edit) your preact.config.js
like the following:
// preact.config.js
export default (config, env, helpers) => {
if (env.isProd) {
config.devtool = false;
}
}
We suggest this config (and others) in our config wiki, which you may want to take a look at: https://github.com/preactjs/preact-cli/wiki/Config-Recipes#disabling-source-maps-using-plugin-helpers