2018-03-07 13:32:38 -05:00
|
|
|
# Dependencies
|
|
|
|
|
2019-08-28 02:06:34 -04:00
|
|
|
## Adding Dependencies
|
2018-05-31 14:24:28 -04:00
|
|
|
|
|
|
|
GitLab uses `yarn` to manage dependencies. These dependencies are defined in
|
|
|
|
two groups within `package.json`, `dependencies` and `devDependencies`. For
|
|
|
|
our purposes, we consider anything that is required to compile our production
|
|
|
|
assets a "production" dependency. That is, anything required to run the
|
|
|
|
`webpack` script with `NODE_ENV=production`. Tools like `eslint`, `karma`, and
|
|
|
|
various plugins and tools used in development are considered `devDependencies`.
|
|
|
|
This distinction is used by omnibus to determine which dependencies it requires
|
|
|
|
when building GitLab.
|
|
|
|
|
|
|
|
Exceptions are made for some tools that we require in the
|
|
|
|
`gitlab:assets:compile` CI job such as `webpack-bundle-analyzer` to analyze our
|
|
|
|
production assets post-compile.
|
|
|
|
|
2019-07-23 13:28:23 -04:00
|
|
|
To add or upgrade a dependency, run:
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2019-07-23 13:28:23 -04:00
|
|
|
yarn add <your dependency here>
|
|
|
|
```
|
|
|
|
|
|
|
|
This may introduce duplicate dependencies. To de-duplicate `yarn.lock`, run:
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2019-07-23 13:28:23 -04:00
|
|
|
node_modules/.bin/yarn-deduplicate --list --strategy fewer yarn.lock && yarn install
|
|
|
|
```
|
|
|
|
|
2018-05-31 14:24:28 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
> TODO: Add Dependencies
|