Skip to content

Commit

Permalink
Merge pull request #85 from dcyriller/fix-addons
Browse files Browse the repository at this point in the history
fix: Allow the babel plugin to be registered for addons
  • Loading branch information
rwjblue authored Jul 20, 2021
2 parents 82652a3 + 8a88281 commit e46a32c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ const { hasPlugin, addPlugin } = require('ember-cli-babel-plugin-helpers');
module.exports = {
name: require('./package').name,

included() {
included(parent) {
this._super.included.apply(this, arguments);

this.addBabelPlugin();
this.addBabelPlugin(parent);
},

addBabelPlugin() {
let app = this._findHost();
addBabelPlugin(parent) {
let pluginPath = resolve(__dirname, './lib/transpile-modules.js');

if (!hasPlugin(app, pluginPath)) {
addPlugin(app, pluginPath);
if (!hasPlugin(parent, pluginPath)) {
addPlugin(parent, pluginPath);
}
}
};

0 comments on commit e46a32c

Please sign in to comment.