This issue is related to previous topic and still not resolved. I spent too much time on this and really hope it can resolved.
Goal: use epicenter lib CommonJS style. Use npm install epicenter module so that latter I can use require to add dependency to it. Currently not working has to put script tag in html file as workaround. It work around does not work well for server side though. Hope to make it work right.
I tried different things including everything Naren has suggested. None of them work, here is closest thing I can get.
- install epicenter using command
npm install git+https://github.com/forio/epicenter-js-libs --save
It outputsEpicenter-JS-Libs@1.5.0 node_modules/Epicenter-JS-Libs
. However I don’t see lib dir under it as other modules does. - in my source code
`
var F = {
util: {},
factory: {},
transport: {},
store: {},
service: {},
manager: {
strategy: {}
},
};
F.service.Data = require(‘Epicenter-JS-Libs/src/service/data-api-service’);
`
Notice I have to put ‘src’ in the path since no lib is present.
- Result: Build error
AuthManager.prototype = $.extend(AuthManager.prototype, { ^ ReferenceError: $ is not defined
Yes, jQuery is not there. somehow npm doesn’t think it depends on jQuery.
Please help.