#why can I see all the source code under sources?

44 messages · Page 1 of 1 (latest)

waxen bladeBOT
#

Hi @uncut grail. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the knowledge sources, I can address your concern about seeing the entire source code of your application, including TypeScript types, in the Sources tab. This is related to sourcemaps, which are used for debugging purposes.

Sourcemaps are enabled by default for the server build and in development mode for the client build. This allows developers to debug their code more easily by mapping the compiled code back to the original source code. However, you're right to be concerned about this in a production environment.

To address this security concern, you can configure the sourcemap settings in your Nuxt configuration. Here's how you can disable or optimize sourcemaps:

  1. You can disable sourcemaps completely by setting them to false in your nuxt.config.ts file:
export default defineNuxtConfig({
  sourcemap: false
})
  1. Alternatively, you can set sourcemaps to hidden, which is now supported in Nuxt. This will generate sourcemaps but not expose them publicly:
export default defineNuxtConfig({
  sourcemap: {
    server: 'hidden',
    client: 'hidden'
  }
})

Nuxt Configuration (https://nuxt.com/docs/api/nuxt-config#sourcemap) provides more details on sourcemap configuration options.

By configuring sourcemaps appropriately, you can prevent your full source code from being visible in the Sources tab, addressing the security concern you've raised.

Remember to always be cautious with sensitive information and ensure that your production builds are properly optimized and secured.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@uncut grail Kapa.ai is still learning and improving, please let me know how I did by reacting below.

uncut grail
#

but I still need it for the sentry module...

south fossil
#

this is how frontend frameworks operate, vue templates are parsed on the client/browser side

south fossil
#

do about what?

uncut grail
south fossil
#

vue needs the vue templates to render them

uncut grail
south fossil
#

how are you deploying?

uncut grail
#

nuxi build?

south fossil
#

that doesn't deploy..

uncut grail
#

what do you mean how am I deploying?

south fossil
#

how is your application running on your server

uncut grail
#

docker builds everything and then deployed to cloudflare

#

ENTRYPOINT ["node", "./server/index.mjs"]

south fossil
#

the files you're pointing at on nuxt.com are the same thing as vue components just not sfc

uncut grail
#

exactly! in my app I can literally see everything. not minified, and organized by folders, also I can even see typescript code (which should be excluded in build time)

south fossil
#

i'm not sure why your deployment is that way - what is "packages" ?

#

that's non-standard as far as i know

uncut grail
#

thats a big monorepo, devided to 2 sites

#

using nuxt layers

#

thats why I have 'packages' folders

south fossil
#

so your layers are the things that are vue files, not your app

uncut grail
#
```bash
root/
│
├── apps/
│   └── base/
│   └── site-1/
│   └── site-2/
│
├── packages/
│   ├── ui/
│   ├── funds/
│   └── ...
│
├── package.json
└── tsconfig.json
#

thats how my app looks like

south fossil
#

i'm not sure how packages is expected to work on this, never seen that before

uncut grail
#

just using nuxt layers. but in a monorepo convention.

south fossil
#

but packages is not a standard nuxt folder

uncut grail
#

i'll send a reference

south fossil
#

i imagine it has something to do with nuxt and/or the build process not knowing it needs to process that folder

uncut grail
#

example of how to create a monorepo using nuxt layers

south fossil
#

looks like it is just using raw vue components from directories

uncut grail
#

thats what im saying... something's wrong

#

and the funny part is that the site also has the minified version as well.......

south fossil
#

idk it looks like you're running the dev process on your site

uncut grail
#

maybe its has something to do with the source maps configuration?

south fossil
#

i've tried w/ remote layers on github and local layers and that's not happening on my setup

#

when you build and run locally does it happen?

uncut grail
#

Okay, just found the issue and thats the sourcemaps configuarion...