How do you know how to import libraries in aurelia-cli -
how these guy's/gal's figure out how import library blog instructions for? not easy since there many blogs giving examples of importing libraries not how figured out. let's @ few libraries.
how figure out how libraries imported in aurelia.json?
examples:
1) "bootstrap" understand jquery deps , resources bootstrap.css include in non-module system.
how did know export @ less export $ instead of "insert-something"?
{ "name": "bootstrap", "path": "../node_modules/bootstrap/dist", "main": "js/bootstrap.min", "deps": [ "jquery" ], "exports": "$", "resources": [ "css/bootstrap.css" ] },
2) "jquery" imported "jquery" in aureia.config. think read importing 1 file don't need export or add resources in bootstrap.
how know jquery in module format , import jquery?
3) "aurelia-dragula plugin" imported resources
"name": "aurelia-dragula", "path": "../node_modules/aurelia-dragula/dist/amd", "main": "index", "resources": [ "dragula-and-drop.js", "dragula-and-drop.html", "dragula.css" ] },
how know resource include , need include resources?
how figure out import statement use if any?
examples:
1) not see import statement jquery see 1 bootstrap.
why case?
2) import {myliby} 'lib' or import * mylib 'lib' or import 'mylib?
i think understand how es6 imports works. please correct me if wrong. use import {mylib} 'name' if library not have default. or use import 'mylib' if have default export. , there import * mylib mylib
3) how figure out if library has default export or if not name exporting , how import?
4) in aurelia.json can name , when import use name?
example config. name , them in import statement use import {something} 'alib. on note in previous question how figure out well
{ "name": "alib", "path": "../node_modules/jsrender/", "main": "jsrender" },
if possible explain in detail answers above questions. me struggle more should , think other people or there not articles on how import library? articles great don't explain how figured out in first place write article telling else how import it.
thank you.
Comments
Post a Comment