2020-05-06 18:21:13 -04:00
|
|
|
## Reloading modules
|
|
|
|
|
2020-06-10 13:43:44 -04:00
|
|
|
By default, a module in the cache will be reused without fetching or
|
|
|
|
re-compiling it. Sometimes this is not desirable and you can force deno to
|
|
|
|
refetch and recompile modules into the cache. You can invalidate your local
|
|
|
|
`DENO_DIR` cache using the `--reload` flag of the `deno cache` subcommand. It's
|
2020-05-06 18:21:13 -04:00
|
|
|
usage is described below:
|
|
|
|
|
2020-06-10 13:43:44 -04:00
|
|
|
### To reload everything
|
2020-05-06 18:21:13 -04:00
|
|
|
|
2020-06-10 13:43:44 -04:00
|
|
|
```ts
|
|
|
|
deno cache --reload my_module.ts
|
|
|
|
```
|
|
|
|
|
|
|
|
### To reload specific modules
|
2020-05-06 18:21:13 -04:00
|
|
|
|
|
|
|
Sometimes we want to upgrade only some modules. You can control it by passing an
|
|
|
|
argument to a `--reload` flag.
|
|
|
|
|
2020-09-28 02:01:32 -04:00
|
|
|
To reload all \$STD_VERSION standard modules:
|
2020-05-06 18:21:13 -04:00
|
|
|
|
2020-06-10 13:43:44 -04:00
|
|
|
```ts
|
2020-07-31 05:12:20 -04:00
|
|
|
deno cache --reload=https://deno.land/std@$STD_VERSION my_module.ts
|
2020-06-10 13:43:44 -04:00
|
|
|
```
|
2020-05-06 18:21:13 -04:00
|
|
|
|
2020-05-09 08:34:47 -04:00
|
|
|
To reload specific modules (in this example - colors and file system copy) use a
|
2020-09-28 02:01:32 -04:00
|
|
|
comma to separate URLs.
|
2020-05-06 18:21:13 -04:00
|
|
|
|
2020-06-10 13:43:44 -04:00
|
|
|
```ts
|
2020-07-31 05:12:20 -04:00
|
|
|
deno cache --reload=https://deno.land/std@$STD_VERSION/fs/copy.ts,https://deno.land/std@$STD_VERSION/fmt/colors.ts my_module.ts
|
2020-06-10 13:43:44 -04:00
|
|
|
```
|
2020-05-06 18:21:13 -04:00
|
|
|
|
2020-05-18 15:53:25 -04:00
|
|
|
<!-- Should this be part of examples? -->
|