Skip to content

Commit

Permalink
Merge pull request #29 from mansona/embroider
Browse files Browse the repository at this point in the history
Add Embroider support
  • Loading branch information
mansona authored Jan 11, 2022
2 parents f6ed85f + 6a147ea commit 90be24e
Show file tree
Hide file tree
Showing 5 changed files with 312 additions and 81 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
- ember-canary
- ember-default-with-jquery
- ember-classic
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions addon/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { getOwnConfig } from '@embroider/macros';

export default getOwnConfig().config;
23 changes: 11 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

var FileCreator = require('broccoli-file-creator');

function findRoot(current) {
var app;

Expand All @@ -19,17 +17,18 @@ function findRoot(current) {
}

module.exports = {
name: require('./package').name,
options: {
'@embroider/macros': {
setOwnConfig: {},
},
},

treeForAddon: function () {
var modulePrefix = findRoot(this).project.config(process.env.EMBER_ENV)[
'modulePrefix'
];
var indexTree = new FileCreator(
'index.js',
"export { default } from '" + modulePrefix + "/config/environment';"
);
name: require('./package').name,

return this._super.treeForAddon.call(this, indexTree);
included() {
this._super.included.apply(this, arguments);
this.options['@embroider/macros'].setOwnConfig.config = findRoot(
this
).project.config(process.env.EMBER_ENV);
},
};
Loading

0 comments on commit 90be24e

Please sign in to comment.