emberjs / ember-cli-babel

Ember CLI plugin for Babel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specifying Babel options results in 'import' in the middle of bundle

maxhq opened this issue · comments

Error:

Build Error (TerserWriter)

"Import" statement may only appear at the top level

Stack Trace and Error Report: /tmp/error.dump.212d6b5aecc3b277dd35bac22e8187ec.log

Steps to reproduce:

npm install -g ember-cli
ember new testapp --lang en
cd testapp/

ember install ember-cli-babel

cat <<'EOF' > ember-cli-build.js
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    'babel': {
      useBuiltIns: 'usage',
      corejs: {
        version: '2.6.12',
      },
    },
  });
  return app.toTree();
};
EOF

npm run build