vuejs / component-compiler-utils

Lower level utilities for compiling Vue single file components
320 stars 75 forks source link

feat: Support uri fragment in transformed require #22

Closed joma74 closed 5 years ago

joma74 commented 6 years ago

My case for this PR is a svg within a html based vue component, where i deployed vue-template-loader for this usage. In this html i put a svg element as in

<svg>
    <use href="~@svg/menu.svg#menu"></use>
</svg>

Root cause is that the whole href is generated by component-compiler-utils and as-is is required by webpack; this must fail because the whole href - including the uri fragment #menu - is not part of any mapped physical file location of such an svg.

joma74 commented 6 years ago

Just for the records: originally requested on https://github.com/ktsn/vue-template-loader/pull/49

yyx990803 commented 6 years ago

Please make sure to follow existing code style:

joma74 commented 5 years ago

Sorry for the merge foxtrot - please squash.