ember-model icon indicating copy to clipboard operation
ember-model copied to clipboard

ES6 import syntax not working as expected

Open patocallaghan opened this issue 7 years ago • 0 comments

I followed the instructions in the README re:using ES6 module imports with Ember Model but unless I'm missing something, this does not work out of the box. You need to create your own shim file in your app to expose these modules.

https://github.com/ebryn/ember-model#ember-cli--es6-modules

For example, my shim looks like this:

(function() {
  function vendorModule() {
    'use strict';
 
    let { attr, belongsTo, hasMany, Model } = self['Ember'];
    return {
      attr,
      belongsTo,
      hasMany,
      Model,
      __esModule: true,
    };
  }
 
  define('ember-model', [], vendorModule);
})();

patocallaghan avatar May 03 '18 09:05 patocallaghan