Update js.md

This commit is contained in:
Bjørn Erik Pedersen 2020-11-25 08:30:20 +01:00 committed by GitHub
parent 087b39d74e
commit e0124e4b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,6 +102,8 @@ For other files (e.g. `JSON`, `CSS`) you need to use the relative path including
import * as data from 'my/module/data.json';
```
Any imports not matching any component in `/assets` will be resolved by ESBuild with the **project directory** as the resolve directory (used as the starting point when looking for `node_modules` etc.). Also see [hugo mod npm pack](/commands/hugo_mod_npm_pack/).
Also note the new `params` option that can be passed from template to your JS files, e.g.:
```go-html-template