How to import an amd module in ember-cli?

前端 未结 3 1544
攒了一身酷
攒了一身酷 2021-02-13 02:13

I am building an EmberJS application with the great help of ember-cli, which is great, but I have an error and I cannot find what I am doing wrong.

Here is

3条回答
  •  天命终不由人
    2021-02-13 02:18

    I got this from locks on #emberjs IRC.

    https://github.com/ef4/ember-browserify

    In your project:

    npm install --save-dev ember-browserify
    npm install --save-dev underscore
    

    In your controller:

    import _ from "npm:underscore";
    

    Then you can use _. For example: _.each([1,2,3], alert);. I took everything out I had manually added to brocfile and package.json. Apparently this will do it for you. Crazy!

提交回复
热议问题