-
Notifications
You must be signed in to change notification settings - Fork 13
Dependencias
sonsoleslp edited this page Aug 14, 2018
·
2 revisions
The dependencies of a node module are normally defined in a package.json. This is a JSON file that includes de version, name, config elements and dependencies among other things.
{
"name": "plugin name", //(mandatory field)
"version" : "plugin version", //(mandatory field)
"dependencies": {
"dependency name": "package version",
},
config:{
"localDependencies":{
"name": "library route"
},
"aliases": {
"dependency name": "name to be exported"
},
"css": {
"name" : "route to css"
}
}
}
Inside a plugin there are three kind of dependencies:
-
NPM dependency: it can be obtained from npm, they are normally public but can be private, they are javascript libraries packed inside a npm repository. Inside package.json they must be in dependencies part. If it wants to be used a global name for the depedency used should be used -> config -> aliases.
-
Local dependency: to inject directly a javascript library inside the app local dependencies should be used. Inside the json should be in -> config -> dependencies.
-
Styles dependency: they