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

Customizable Babel Configuration for Modules #246

Closed

Conversation

giuseppeg
Copy link
Contributor

Closes #242

This change is backwards compatible and should allow to reuse the helper from src/babel/evaluate.js by making the the babel configuration used in Module customizable.

@giuseppeg giuseppeg force-pushed the reusable-babel-evaluate branch from d9d9f74 to 02ebf48 Compare October 11, 2018 19:59
@callstack-bot
Copy link

callstack-bot commented Oct 11, 2018

Hey @giuseppeg, thank you for your pull request 🤗.
The coverage report for this branch can be viewed here.

@@ -57,7 +57,8 @@ const resolve = (path, t, requirements) => {
module.exports = function evaluate(
path /* : any */,
t /* : any */,
filename /* : string */
filename /* : string */,
module /* : ?Module */ = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you want to customize the module instance? I was thinking that you just add an argument for a custom transform function here, and then do something like m.transform = transform: https://github.com/callstack/linaria/blob/master/src/babel/evaluate.js#L150

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because otherwise I cannot patch transform when i use evaluate.js - you create an instance of Module inside of the function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but yeah i could pass a transform function instead

@giuseppeg
Copy link
Contributor Author

giuseppeg commented Oct 12, 2018

Closing in favor of #247

@giuseppeg giuseppeg closed this Oct 12, 2018
satya164 pushed a commit that referenced this pull request Oct 12, 2018
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.

3 participants