Skip to content

Commit

Permalink
fix: add ember-cli option to not import react
Browse files Browse the repository at this point in the history
  • Loading branch information
philtobias authored and alexlafroscia committed Jul 4, 2018
1 parent 2bff577 commit d1bdd31
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ module.exports = {
included() {
this._super.included.apply(this, arguments);

const opts = this.appOptions();
const cliOpts = opts['ember-react-components'];
const outputFile = (cliOpts && cliOpts.outputFile) || '/assets/vendor.js';

this.import(
{
development: 'node_modules/react/umd/react.development.js',
production: 'node_modules/react/umd/react.production.min.js'
},
{
using: [{ transformation: 'amd', as: 'react' }]
using: [{ transformation: 'amd', as: 'react' }],
outputFile
}
);

Expand All @@ -34,11 +39,11 @@ module.exports = {
production: 'node_modules/react-dom/umd/react-dom.production.min.js'
},
{
using: [{ transformation: 'amd', as: 'react-dom' }]
using: [{ transformation: 'amd', as: 'react-dom' }],
outputFile
}
);

const opts = this.appOptions();
opts.babel = opts.babel || {};
opts.babel.plugins = opts.babel.plugins || [];

Expand Down

0 comments on commit d1bdd31

Please sign in to comment.