Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Add ability to pass static options to transpilation. #75

Merged
merged 1 commit into from
Aug 30, 2019

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 30, 2019

This allows consumers to specify additional options during compilation, for example you might need to ensure that the compiled template has a moduleName set (e.g. if you are testing an AST plugin that needs to know the compiled templates module name).

Note: this functionality is only possible with the CallExpression version of hbs. This is because there is no way to pass additional arguments to a TaggedTemplateExpression.

This allows consumers to specify additional options during compilation,
for example you might need to ensure that the compiled template has a
moduleName set (e.g. if you are testing an AST plugin that needs to know
the compiled templates module name).

Note: this functionality is only possible with the `CallExpression`
version of `hbs`. This is because there is no way to pass additional
arguments to a `TaggedTemplateExpression`.
@rwjblue
Copy link
Member Author

rwjblue commented Aug 30, 2019

I made a slimmed down version of this plugin in ASTExplorer if folks want to play with it:

https://astexplorer.net/#/gist/51cf2e40a39f01ccf4e9cd2d9cdd96af/2c99758e9b185da1203d43b9eef82cf25dcf3f02

@rwjblue rwjblue merged commit c47570a into ember-cli:master Aug 30, 2019
@rwjblue rwjblue deleted the accept-options branch August 30, 2019 13:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant