1

I'm the maintainer of the ember-cli preprocessor for java.properties files to generate a JS file exporting a JSON object with values. The problem I'm running into is that the file is correctly processed (ES2015 flavored), but that files is not transpiled into ES5.

The generated app.js file contains this statement: export default {"foo":"bar"} but that should be transpiled into something like this:

define('my-app/locales/en', ['exports'], function (exports) {
  exports['default'] = {"foo":"bar"};
});

Is it possible to generate the ES2015 flavored file and after that run the default transpiler to create the ES5 variant?

Willem de Wit
  • 8,604
  • 9
  • 57
  • 90
  • Make sure ember-cli-babel is in your dependencies hash in package.json. Also ensure your addon is run before ember-cli-babel by putting 'ember-cli-babel' in the `after` array in package.json – Gaurav Jan 30 '17 at 18:07

1 Answers1

1

I had to define this addon to run before ember-cli-babel in package.json.

{
  ...
  "ember-addon": {
    "main": "index.js",
    "before": "ember-cli-babel"
  },
}
Willem de Wit
  • 8,604
  • 9
  • 57
  • 90