1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-12-27 00:31:35 +01:00
foris-js/docs/development.md

26 lines
939 B
Markdown
Raw Normal View History

2022-02-25 15:09:18 +01:00
Sooner or later, you will face with situation when you want/need to make some
changes in the library. Then the most important tool for you it's the
2020-08-18 15:39:00 +02:00
[`npm link`](https://docs.npmjs.com/cli/link).
2020-06-04 22:52:24 +02:00
2022-02-25 15:09:18 +01:00
Please, notice that it will not work if you link the library just from the root
of the repo. It happens due to the location of sources `./src`. You need to pack
the library first, `make pack` and then link it from the `./dist` directory.
2020-06-04 22:52:24 +02:00
2022-02-25 15:09:18 +01:00
Yeah, it's not such a comfortable solution for development. But it can be fixed
by writing a small script similar to making a pack but by linking every file and
directory from `./src` to the same directory and linking then from it. Notice
that you need to link a `package.json` and a `package-lock.json` as well.
2020-06-04 22:52:24 +02:00
So step by step:
```bash
make pack;
cd dist;
npm link;
cd $project_dir/js # Navigate to JS directory of the project where you want to link the library
npm link foris
```
And that's it ;)