Thursday, 1 June 2017

Import Browserify package into Ember-Cli project

I've installed the following library via bower: https://github.com/kaimallea/isMobile/blob/master/isMobile.js

And imported it into my ember-cli project via in ember-cli-build.js: app.import('bower_components/isMobile/isMobile.min.js');

While it's available via window, I also want to use it directly in Fastboot mode in node.

You can see in the source of the library, that it actually exports itself for Browserify via module.exports = instantiate();, so I tried to import it via import isMobile from '../bower_components/isMobile/isMobile.min.js';, but that throws

Error: Could not find module "frontend/bower_components/isMobile/isMobile.min.js" imported from "frontend/helpers/is-mobile-test"

I think I'm just missing something obvious.



via Sbbs

No comments:

Post a Comment