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

fix: merge custom queries rather than appending #1911

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

danielroe
Copy link
Member

Currently we simply append any existing resourceQuery to the end of any generated query string. In the event of a custom query being passed this leads to an invalid query, such as:

const scriptQuery = '?vue&type=script&lang=js?custom=true'
const templateQuery = '?vue&type=template&id=49803768?custom=true'
const styleQuery = '?vue&type=style&index=0&id=49803768&lang=css?custom=true'

The four locations where this happens are:

const query = `?vue&type=script${attrsQuery}${resourceQuery}`

const query = `?vue&type=template${idQuery}${scopedQuery}${tsQuery}${attrsQuery}${resourceQuery}`

const query = `?vue&type=style&index=${i}${idQuery}${inlineQuery}${attrsQuery}${resourceQuery}`

const query = `?vue&type=custom&index=${i}${blockTypeQuery}${issuerQuery}${attrsQuery}${resourceQuery}`

I realise this is a bit of an edge case, but as long as we are appending resourceQuery to the end of a query string we should probably normalise it.

@haoqunjiang haoqunjiang merged commit 9e4249a into vuejs:next Oct 28, 2022
@danielroe danielroe deleted the fix/query-merging branch October 28, 2022 08:33
freddy38510 pushed a commit to freddy38510/vue-loader that referenced this pull request Nov 17, 2022
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

Successfully merging this pull request may close these issues.

2 participants