Skip to content

Conversation

@senthilp
Copy link
Contributor

Please note that there are no test cases related to plugins in lasso-require.

@philidem
Copy link
Contributor

They change looks good to me and I think it's smart to utilize the *.es6 file extension for the ES6 files (although Babel can handle some proposed ES7 features as well).

All of the tests for lasso-require were moved to the lasso repo since lasso-require is a core plugin.

In the future it would be nice if we made ES6 a core part of lasso for all JavaScript code. Since we're using esprima to parse JavaScript files and find the require() statements, it would be nice if we could integrate with the Babel tooling so that we don't end up parsing the JavaScript code twice (once during Babel transform and again while looking for the require() statements and other AST transformations). When I first investigated this, there wasn't a way to plugin to the Babel flow but I think that is ready now. See lasso-js/lasso#45 and babel/babel#987.

I think this should be merged and then we can look at more closely integrating Babel.

@senthilp
Copy link
Contributor Author

@philidem Yes agree. The babel transpiler returns the AST result.ast, which can be used for require() API. But I am not sure if babel operates on an AST. The input to the babel API is either code or filename.

@yomed
Copy link
Contributor

yomed commented Sep 15, 2015

Could this be enabled on regular *.js files as well, maybe via config?

patrick-steele-idem added a commit that referenced this pull request Sep 17, 2015
Adding support for es6 files through babel compiler
@patrick-steele-idem patrick-steele-idem merged commit 870e587 into lasso-js:master Sep 17, 2015
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.

4 participants