Skip to content
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

File path exposed in bundled SFC #127

Open
Aterbonus opened this issue Jun 3, 2018 · 4 comments
Open

File path exposed in bundled SFC #127

Aterbonus opened this issue Jun 3, 2018 · 4 comments

Comments

@Aterbonus
Copy link

screenshot_20180603_001838

This happens in minified and unminified files.

@egoist
Copy link
Owner

egoist commented Jun 3, 2018

hmm I believe that's a rollup-plugin-vue issue

@Aterbonus
Copy link
Author

Vue Component Compiler strips that part when process.env.NODE_ENV === 'production'

https://github.com/vuejs/vue-component-compiler/blob/4280da00fbbf923a35a1b33cd206e96db87d951c/src/assembler.ts#L214

https://github.com/vuejs/vue-component-compiler/blob/976d4f1e1d679c0c0d117c2643fbdbf5e0c85fa2/src/index.ts#L29

Maybe process.env.NODE_ENV is not setted at bundle time?

@egoist
Copy link
Owner

egoist commented Jun 3, 2018

nope, it's only set in app code (used by rollup-plugin-replace) for umd and iife bundle

bili/src/index.js

Lines 304 to 310 in 5cd9667

let env = options.env
if (format === 'umd' || format === 'iife') {
env = {
NODE_ENV: compress ? 'production' : 'development',
...env
}
}

@Aterbonus
Copy link
Author

I settled this calling bili after setting NODE_ENV:

NODE_ENV=production bili src/TimedProgressBar.vue

I don't know if there is a better way. I think it will be good if bili could manage this and make it safer by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants