Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.

app.import is not a function #41

Open
michalsnik opened this issue Mar 29, 2017 · 7 comments
Open

app.import is not a function #41

michalsnik opened this issue Mar 29, 2017 · 7 comments

Comments

@michalsnik
Copy link

Hey, I was playing with Glimmer today and found out that it's application pipeline doesn't have import method, but in the generated blueprint there is information that it should be there:

// Use `app.import` to add additional libraries to the generated
// output files.

When trying to import any additional resources I'm getting app.import is not a function.
I think it would be really good to have this in glimmer pipeline as well.

@dgeb
Copy link
Member

dgeb commented Mar 30, 2017

We agree and will be implementing this very soon! Sorry for the doc mismatch.

@voltidev
Copy link

voltidev commented Jul 16, 2017

I'm sure the workaround below is not a good way to do it, and yes I'm using private API here, but it works for me at the moment (it will also fingerprint vendor.js for production as you expect) :

$ npm install --save-dev broccoli-concat broccoli-merge-trees

ember-cli-build.js:

'use strict';

const GlimmerApp = require('@glimmer/application-pipeline').GlimmerApp;
const Concat = require('broccoli-concat');
const MergeTrees = require('broccoli-merge-trees');

class CustomApp extends GlimmerApp {
  publicTree() {
    let originalTree = super.publicTree();

    let vendorScripts = new Concat('node_modules', {
      inputFiles: [
        'core-js/client/core.min.js',
        'whatwg-fetch/fetch.js'
      ],
      outputFile: 'vendor.js',
    });

    return new MergeTrees([originalTree, vendorScripts], { overwrite: true });
  }
}

module.exports = function(defaults) {
  let app = new CustomApp(defaults, {
    fingerprint: {
      exclude: ['apple-touch-icon', 'favicon', 'mstile', 'android-chrome']
    }
  });

  return app.toTree();
};

@jamesarosen
Copy link

I've started work on this here. It's far from complete at this point.

@charlesfonlupt
Copy link

charlesfonlupt commented Nov 29, 2017

Hey. I am playing with Glimmer today. I was trying to import bootstrap-sassy, but the ember app crash.

After trying to reinitiate the server I receive that message :

app.import is not yet implemented for GlimmerApp

Any solution or work around ?

@rwjblue
Copy link
Member

rwjblue commented Dec 18, 2017

@jamesarosen - Have you had a chance to make any progress?

@Mike-Neto
Copy link

Any news on this, I'd like to take advantage of most ember addons inside glimmer apps.

I could help in getting this done, however I'd need some guidance on what to do.

@Argun
Copy link

Argun commented Jul 3, 2020

Still not implemented import function, is there any solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants