How do I include epf.js in a project using ember-tools?
I'm integrating an ember project to use ember-tools because I want nice
build tools. My project also uses epf, and I encountered a problem when I
tried to include epf.js as a library. My instinct was just to lump epf.js
into the vendor/ folder that ember-tools had generated for me... but this
doesn't work. When I run ember build it spits out the following:
Change detected: !config/app.js
created: js/templates.js
created: js/index.js
created: js/application.js
build time: 493 ms
Error: Cannot find module '/lib/version.js'
I think this is happening because epf.js uses commonjs syntax, as in
require.define('/lib/index.js', function (module, exports, __dirname,
__filename) {
global.Ep = Ember.Namespace.create();
require('/lib/version.js', module);
and ember-tools' build command thinks these require statements are
declaring modules that it should build.
Is this a problem in general when using commonjs syntax? Is there some
easy fix that will allow me to use ember-tools' build command to include
epf.js, or should I keep a separate lib folder somewhere and just put a
<script> tag in index.html?
Really nice blog post.provided a helpful information.I hope that you will post more updates like this AngularJS 5 Online Course Bangalore
ReplyDelete