i am working with next.js
we have a contact page and we dont want bots to get the emails address displayed in the cards.
One of my co-workers found a solution so that they don’t appear in the html source code.
how ever they appear in the js source code along with the rest of the code.
here is what the next.config looks like:
/** @type {import('next').NextConfig} */
const path = require('path');
const nextConfig = {
reactStrictMode: true,
productionBrowserSourceMaps: false,
swcMinify: true,
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'images.ctfassets.net',
pathname: '/4a2bd25mudy4/**',
},
],
},
output: 'standalone',
};
module.exports = nextConfig;
Even with productionBrowserSourceMaps, i can find the files and access the source code.
Is it because i didn’t empty cache or navigation data?
I also tried to put it in .env, its not doing anything.
I found some threads talking about sentry. but when i build sentry seems to be depriciated and not supported anymore.
what can i do to hide the source code? or at least hide the email adresses both in the html source code and js source code.