0
votes

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.

1

1 Answers

0
votes

The mentioned library seems to be available as a node module as well. You can declare it as a fastboot dependency and execute it as mentioned in their docs when the app runs in fastboot mode