Skip to content

ES6 import syntax not working as expected #482

@patocallaghan

Description

@patocallaghan

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);
})();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions