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

Support post loaders for template blocks #1500

Merged
merged 2 commits into from
Feb 28, 2019

Conversation

davidguilherme
Copy link

I know there is already a MR that sorts this issue out but I think bringing the postLoader option back is not the best approach to solve this issue. This merge request proposes a solution that allows post loaders to be applied after the template loader with no extra options.

Motivation
In our project we would like to be able to execute a custom babel-macro in our templates and that requires us to process the compiled template using babel. Currently the v15 does not allow this. See: #1309.

Description
The solution implemented in this merge request detects which loaders have enforce: 'post' option looking at the pitchExecuted flag in the loader object. Once the VueLoaderPlugin injects the pitcher at the beginning of the loaders list that means the pitcher's pitch would be executed first than any loader. So, every loader which has pitchExecuted equals true would be a post loader. In that way we can inject the template loader between the post loaders and the rest of them.

Fixes #1309.

@yyx990803 yyx990803 merged commit 731a7ad into vuejs:master Feb 28, 2019
@yyx990803
Copy link
Member

Thanks! This is great. Didn't think that you use pitchExecuted to detect them.

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.

None yet

2 participants