0

I've started a project with the new vue-cli 3.0 and I've added the qwery npm module in node package.json

npm i qwery

and in my-file.js which is at same level as main.js I import it the following way:

import {qwery as $q} from "qwery"

The build goes ok however in the browser $q is undefined and webpack has imported it as qwery__WEBPACK_IMPORTED_MODULE_8__.

Clearly I'm not doing it the right way can somebody give me a hint what I'm doing wrong?

Bat Man
  • 369
  • 1
  • 4
  • 14

1 Answers1

0

You need to import it like this

import $q from 'qwery';
dysfunc
  • 2,008
  • 1
  • 13
  • 15
  • 10x it does work. Somehow magically because I don't see no `$q` in closure when debugging in browser. Why is that no idea? – Bat Man Aug 20 '18 at 19:39
  • if you want to create a global ref to `$q` just add `window.$q = $q;` under that import statement. – dysfunc Aug 24 '18 at 00:07