Skip to content

Commit

Permalink
chore: 📝 update README
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDutchCoder committed May 8, 2021
1 parent 582c818 commit 7846678
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ export default {
{
...ViteAddScripts([
{
position: 'head',
position: 'body',
sort: 2,
content: '<script>window.foo = {}</script>'
},
{
position: 'body',
sort: 1,
content: '<script>window.bar = {}</script>'
}
]),
apply: 'build',
Expand All @@ -33,7 +39,7 @@ export default {

## Options
You can use the `position` option to add the script to either the head or the
body section of the index.html file
body section of the index.html file. By default `'head'` will be assumed.

The `content` option is the actual content that gets written to the file.
Normally it would be a stringified version of the script tags and their
Expand All @@ -46,12 +52,10 @@ as well.
```js
...ViteAddScripts([
{
position: 'head',
sort: 3,
content: '<script>window.foo = {}</script>'
},
{
position: 'head',
sort: -2,
content: '<script>window.bar = {}</script>'
},
Expand Down

0 comments on commit 7846678

Please sign in to comment.