"name" in @Component options is obfuscated (?) in build version
See original GitHub issueRepro: https://github.com/sp00x/vue-typescript-name-bug
2 components, Foo (ts) and Bar (js) registered as global components in main.ts using
import Foo from '@/components/Foo.vue';
import Bar from '@/components/Bar.vue';
Vue.component(Foo.name, Foo) // typescript
Vue.component(Bar.name, Bar) // javascript
With yarn serve
it logs in the console:
in App.vue:
Foo.name = Foo
Bar.name = Bar
in main.ts
Foo.name = Foo
Bar.name = Bar
and renders
Foo:
foo
- Bar:
bar
With yarn build
output it logs in the console:
in App.vue:
Foo.name = t
Bar.name = Bar
in main.ts
Foo.name = t
Bar.name = Bar
renders:
Foo: - Bar:
bar
Foo
is a typescript SFC, where as Bar
is a regular javascript SFC with export default { name: 'Bar' }
Seems like the typescript value is being obfuscated or uglified somehow?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
How to configure functions in Vue 2 project from being ...
Is there a way (possibly in vue.config.js) that I can select certain function names from being obfuscated during build?
Read more >Obfuscating Dart code
Obfuscation hides function and class names in your compiled Dart code, making it difficult for an attacker to reverse engineer your proprietary app....
Read more >Shrink, obfuscate, and optimize your app
Learn how to shrink code in your release build to remove unused code and resources.
Read more >Common ProGaurd rules you must know for Android
app/build.gradleandroid { buildTypes { release { // Enables code shrinking, obfuscation, and optimization for only
Read more >How to obfuscate Blazor App?
It offers names obfuscation, control flow obfuscation and code ... by the ArmDot demo version 1>[ArmDot] Finished 1>Done building project ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is actually a side effect of terser webpack plugin. If you disable terser’s mangling, things work fine. I added the following in my nuxt config in build.extend() function:
This worked for me in webpack4 without increasing the bundle size too much