-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Update README for ember-cli-babel@6 #127
Comments
I would love help from someone, if they have time to start working on this... |
The current README contains incorrect code: treeForAddon(tree) {
let addon = this.addons.find(addon => addon.name === 'ember-cli-babel'); // find your babel addon
let options = addon.buildBabelOptions({
'ember-cli-babel' // <--- ### INCORRECT ###
})
return addon.transpileTree(tree, {
'babel': {
// any babel specific options
},
'ember-cli-babel': {
// any ember-cli-babel options
}
});
} I don't really understand what you originally try to achieve here and where to put |
The |
Shouldn't the We're having some trouble with in-repo-addons over on Slack. I created a demo app here: https://github.com/buschtoens/in-repo-addon-demo /* eslint-env node */
'use strict';
module.exports = {
name: 'foo-addon',
isDevelopingAddon: function() {
return true;
},
treeForAddon(tree) {
const addon = this.addons.find(addon => addon.name === 'ember-cli-babel');
return addon.transpileTree(tree);
}
}; |
When you turn on the custom
Here's a diff: https://gist.github.com/buschtoens/20a8a96b9c5ac07b73db0ef96abf08e3/revisions |
#154 did a significant pass to refactor the README. I believe the snippets have been simplified (and are now valid), and all of the options we support are documented. Closing... |
High Level items:
babel-preset-env
to control transpilation.project.targets
property (which comes from config/targets.js`) is used to pass babel-preset-env's list of targets.options.babel
are passed on tobabel-preset-env
New public API's:
transpileTree
(from Expose a public mechanism to transpile a tree. #126)isPluginRequired
(from 16ed336 and Fix issues with isPluginRequired. #117)options.babel6
for backwards compat with older ember-cli versions (which were sharing the projects babel config fromember-cli-build.js
between both the app/addon itself and ember-cli's internal transpilation)Plugin ordering:
options.babel.plugins
options['ember-cli-babel'].compileModules
is trueoptions.babel.postTransformPlugins
The text was updated successfully, but these errors were encountered: