Skip to content

Instantly share code, notes, and snippets.

@stfcodes
Forked from caseywatts/0 README.md
Created November 22, 2017 21:11
Show Gist options
  • Save stfcodes/713d0eda2d15e34fd58a4fa4be3bda8f to your computer and use it in GitHub Desktop.
Save stfcodes/713d0eda2d15e34fd58a4fa4be3bda8f to your computer and use it in GitHub Desktop.

Revisions

  1. @caseywatts caseywatts revised this gist Nov 22, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 0 README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    `app.import` works with `node_modules` now! [As of Ember 2.15](https://www.emberjs.com/blog/2017/09/01/ember-2-15-released.html#toc_app-import-files-within-node_modules). Previously it only worked with `bower_components` and `vendor`.
    `app.import()` works with `node_modules` now! [As of Ember 2.15](https://www.emberjs.com/blog/2017/09/01/ember-2-15-released.html#toc_app-import-files-within-node_modules). Previously it only worked with `bower_components` and `vendor`.

    Docs for `app.import` are here:
    https://ember-cli.com/managing-dependencies#standard-non-amd-asset
  2. @caseywatts caseywatts revised this gist Nov 22, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion 0 README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,8 @@
    `app.import` works with `node_modules` now! [As of Ember 2.15](https://www.emberjs.com/blog/2017/09/01/ember-2-15-released.html#toc_app-import-files-within-node_modules). Previously it only worked with `bower_components` and `vendor`.

    Docs for `app.import` are here:
    https://ember-cli.com/managing-dependencies#standard-non-amd-asset
    https://ember-cli.com/managing-dependencies#standard-non-amd-asset

    This method (vendor-shim) wraps the global export into an es6 module (but the global one is still present). It doesn't use an es6 interface even if the library offers one, but that's okay for my use case.

    Things could still be easier, see [this thread](https://github.com/ember-cli/rfcs/issues/84) for the current state of that.
  3. @caseywatts caseywatts revised this gist Nov 22, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions 0 README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    `app.import` works with `node_modules` now! [As of Ember 2.15](https://www.emberjs.com/blog/2017/09/01/ember-2-15-released.html#toc_app-import-files-within-node_modules). Previously it only worked with `bower_components` and `vendor`.

    Docs for `app.import` are here:
    https://ember-cli.com/managing-dependencies#standard-non-amd-asset
  4. @caseywatts caseywatts revised this gist Nov 22, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion ember-cli-build.js
    Original file line number Diff line number Diff line change
    @@ -10,9 +10,10 @@ module.exports = function(defaults) {

    app.import('node_modules/d3/d3.js');
    app.import('node_modules/d3/d3.css');
    app.import('vendor/shims/d3.js');

    app.import('node_modules/c3/c3.js');
    app.import('node_modules/c3/c3.css');
    app.import('vendor/shims/d3.js');
    app.import('vendor/shims/c3.js');
    return app.toTree();
    };
  5. @caseywatts caseywatts created this gist Nov 22, 2017.
    15 changes: 15 additions & 0 deletions c3.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    // vendor/shims/c3.js
    // generated by `ember generate vendor-shim c3`

    (function() {
    function vendorModule() {
    'use strict';

    return {
    'default': self['c3'],
    __esModule: true,
    };
    }

    define('c3', [], vendorModule);
    })();
    15 changes: 15 additions & 0 deletions d3.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    // vendor/shims/d3.js
    // generated by `ember generate vendor-shim d3`

    (function() {
    function vendorModule() {
    'use strict';

    return {
    'default': self['d3'],
    __esModule: true,
    };
    }

    define('d3', [], vendorModule);
    })();
    18 changes: 18 additions & 0 deletions ember-cli-build.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    /* eslint-env node */
    'use strict';

    const EmberApp = require('ember-cli/lib/broccoli/ember-app');

    module.exports = function(defaults) {
    let app = new EmberApp(defaults, {
    // Add options here
    });

    app.import('node_modules/d3/d3.js');
    app.import('node_modules/d3/d3.css');
    app.import('node_modules/c3/c3.js');
    app.import('node_modules/c3/c3.css');
    app.import('vendor/shims/d3.js');
    app.import('vendor/shims/c3.js');
    return app.toTree();
    };