New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"component.__file" uses absolut path #258

Closed
s-bauer opened this Issue Jan 13, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@s-bauer
Copy link

s-bauer commented Jan 13, 2019

There has been an issue about this before, but it was closed, but not fixed (as far as I understand):
#221

The problem is that I want to bundle and release a vuejs component library. However it contains absolut paths like the following

component.__file = "D:\\Source\\office-ui-fabric-vue\\packages\\office-ui-fabric-vue\\src\\FocusTrapZone\\FocusTrapZone.vue";

I did not find any solution on how to remove this! It even states in a comment above the line: "// For security concerns, we use only base name in production mode.". This is not the case however!

@znck

This comment has been minimized.

Copy link
Member

znck commented Jan 14, 2019

https://rollupjs.org/guide/en#command-line-flags

--environment <values>

Pass additional settings to the config file via process.ENV.

rollup -c --environment BUILD:production
will set process.env.BUILD === 'production'. This enables you for instance to overwrite environment variables in package.json scripts:

// in package.json

{
  "scripts": {
   "build": "rollup -c --environment INCLUDE_DEPS,BUILD:production"
  }
}

If you call this script via:

npm run build -- --environment BUILD:production

@znck znck closed this in e28b7ab Jan 14, 2019

gluons added a commit to gluons/vue-up that referenced this issue Jan 20, 2019

🐛 Set `NODE_ENV` to `production` when bundle
Also prevent exposing full path of component file in `component.__file`. (See vuejs/rollup-plugin-vue#258)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment