mardi 16 avril 2019

How to use imported third-party js (not addon/npm package) in controller/component?

I have put my js files (eva.min.js/feather.min.js and so on) in vendor dir, then I imported them in ember-cli-build.js (app.import('vendor/eva.min.js')). But how to use it?

I tried something like import eva from 'eva'/'eva.min'/'eva.min.js' or import Eva from 'eva'; and so on, but it doesn't work.

  app.import('vendor/eva.min.js');
  app.import('vendor/bootstrap.min.js');
  app.import('vendor/feather.min.js');
  app.import('vendor/popper.min.js');
  app.import('vendor/jquery-slim.min.js');
  app.import('vendor/swipe.js');

import Swipe from 'swipe';

Console usually gives me the 'could not find the module' mistake. And I don't have deep background in programming, so I would high appreciate if you explained the problem as simple as possible.




Aucun commentaire:

Enregistrer un commentaire