Ember-cli: Question: How to include ember-template-compiler.js in ember-cli-build.js when using ember-source npm package

Created on 24 Jan 2017  路  4Comments  路  Source: ember-cli/ember-cli

So we upgraded to [email protected] and were trying out ember-source npm module, instead of installing ember from bower.json.

We had an import like,
"bower_components/ember/ember-template-compiler.js" in ember-cli-build.js
to do dynamic HBS compiling in some of our tests.

But with ember-source, this file lives in node_modules directory, and importing this file or any other files from node_modules in ember-cli-build.js fails.

How do we use both ember-source and include ember-template-compiler?

Most helpful comment

I believe the following should work:

app.import('vendor/ember/ember-template-compiler.js');

Please give that a whirl, and let us know!

All 4 comments

I believe the following should work:

app.import('vendor/ember/ember-template-compiler.js');

Please give that a whirl, and let us know!

@rwjblue well it works, thanks for the tip. So we went ahead with ember-source :tada:

But can you please explain, how does that import work?
As on file system, there is no file like that in our vendor folder.

I'm gonna piggy back on this issue. what if the asset we're trying to import is in some node module other than ember? as in bootstrap's node module?

if you said something like app.import('vendor/ember-source/dist/ember-template-compiler.js'); I'd happily assume that there is magical node_modules, vendor linkage that you provided since you guys dropped the bower requirement. doesn't seems to be the case 馃槃

@fakalit you can read about solutions to your problem at https://simplabs.com/blog/2017/02/13/npm-libs-in-ember-cli.html

@manimis902 closing the issue as it appears that your problem is resolved now :)

Was this page helpful?
0 / 5 - 0 ratings