Skip to content

Dep_management

Tiago Jesu edited this page Oct 24, 2018 · 1 revision

Frontend dependency management

Although this subject is already described in pATLAS gitbook here, in this section we aim to make a brief explanation on how the pATLAS frotend dependencies are managed.

Installation

Dependencies (node modules) are installed either through yarn or npm, which fetch the information available in the package.json located in static folder.

To install a new dependency just use:

yarn add <module>

or

npm install <module> --save

Imports

Dependency imports are made in the entry-point.js file, located in the same static folder.

Since pATLAS is not a native nodejs application, this entry-point.js is compiled by webpack generating a bundle.min.js, using the following command:

# assuming that we are in the static folder
node_modules/webpack/bin/webpack.js entry-point.js

Note however, that updating the apps bundle.min.js is only required if some of the dependencies change in the entry-point.js. bundle.min.js isn't available in github because the idea is to be generated in the production environment. For developer environment the command yarn run start can be executed within the static folder.

Note: The bundle.min.js is then imported within the index.html file. All custom javascript of the pATLAS project are directly loaded to the index.html without the handling of webpack.

Clone this wiki locally