Nuxt.js: Absolute paths of working directory in build output scripts

Created on 15 Aug 2017  路  4Comments  路  Source: nuxt/nuxt.js

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

This question is available on Nuxt.js community (#c1228)
available soon

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.cssSourceMap will be available to disable all css intermediate source map.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bimohxh picture bimohxh  路  3Comments

uptownhr picture uptownhr  路  3Comments

vadimsg picture vadimsg  路  3Comments

VincentLoy picture VincentLoy  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments