Hi,
How can I hide my machine working directory in the build output scripts?
After I run nuxt build,
In my outputs e.g. 5.nuxt.bundle.3fe7b8ff93ec0714c5d3.js I see source maps for inlined styles and the absolute paths of my current working machine:
...
{version:3,sources:["C:/frontend/components/detail/Schedule.vue"],names:[],mappings:"AACA,wBACE,iBAAkB,
...
I don't want it to be exposed in production.
I'm using the build.extractCSS config set to true.
Regards,
Robert
Hello @robertbakker, this means that you are using absolute paths to point to your components within your project. If you switch to using relative paths, that will obscure this slightly. (Rather than C:/frontend/components/detail/Schedule.vue, it might read ../../frontend/components/detail/Schedule.vue).
Other than that, the next step would be to disable mapping entirely.
Hi. Besides the point of @bayssmekanique (And the fact that Nuxt also internally uses relative paths for templates) in order to disable css source maps a new option build.cssSourceMap will be available to disable all css intermediate source map.
Hi guys, thanks for your responses. I did some quick tests but it does not seem to matter if I'm using relative or absolute paths for importing.
import Schedule from '../Schedule';
// or
import Schedule from '~/components/detail/Schedule';
The absolute paths will show up in the build output.
Anyway it does not matter when the build.cssSourceMap will be available.
Cheers,
Robert
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi. Besides the point of @bayssmekanique (And the fact that Nuxt also internally uses relative paths for templates) in order to disable css source maps a new option
build.cssSourceMapwill be available to disable all css intermediate source map.