Skip to content

Allow passing a custom compiler through options #1197

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

Closed
rigor789 opened this issue Mar 20, 2018 · 2 comments
Closed

Allow passing a custom compiler through options #1197

rigor789 opened this issue Mar 20, 2018 · 2 comments

Comments

@rigor789
Copy link

I'm wondering if we could allow specifying a custom template compiler to be used here

const compile =
isServer && compiler.ssrCompile && options.optimizeSSR !== false
? compiler.ssrCompile
: compiler.compile

The reason this would be useful is that we could more easily allow vue-loader to work with different platforms such as nativescript-vue.

Our goal is to keep feature parity with vue-loader, without having to maintain a fork which could easily get out of sync.

I think it can be as simple as this

const compilerToUse = options.templateCompiler || compiler

const compile =
    isServer && compilerToUse.ssrCompile && options.optimizeSSR !== false
      ? compilerToUse.ssrCompile
      : compilerToUse.compile

This would allow us to create a loader that is run before vue-loader, which would assemble a .vue file based on the targeted platform, and let vue-loader take care of the rest the same way it does for the web.

A more detailed write up of what we are working on can be found here: nativescript-vue#1

@vue-bot
Copy link

vue-bot commented Mar 20, 2018

Hello, your issue has been closed because it does not conform to our issue requirements. In order to ensure every issue provides the necessary information for us to investigate, we require the use of the Issue Helper when creating new issues. Thank you!

@rigor789
Copy link
Author

Sorry about that, the usual commented text was not present when submitting the issue, so I thought this repo was not using the issue helper yet. (issue template is ignored when creating an issue after selecting a code range)

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