You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-23Lines changed: 35 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,18 +72,23 @@ directory, the OS environment, and default arguments to the
72
72
```elixir
73
73
config :bun,
74
74
version:"1.1.22",
75
-
default: [
75
+
assets: [
76
+
args: [],
77
+
cd:Path.expand("../assets", __DIR__)
78
+
],
79
+
js: [
76
80
args:~w(build js/app.js),
77
81
cd:Path.expand("../assets", __DIR__)
78
82
]
79
83
```
80
84
81
-
When `mix bun default` is invoked, the task arguments will be appended
82
-
to the ones configured above.
85
+
When `mix bun js` is invoked, it will invoke `bun build js/app.js`
86
+
appending any argument given to the task. You can also use
87
+
`mix bun assets` to run any `bun` command in the `assets` directory.
83
88
84
89
## Adding to Phoenix
85
90
86
-
To add `bun` to an application using Phoenix, you need only four steps. Installation requires that Phoenix watchers can accept module-function-args tuples which is not built into Phoenix 1.5.9.
91
+
To add `bun` to an application using Phoenix, you need only four steps. Installation requires that Phoenix v1.6+:
87
92
88
93
First add it as a dependency in your `mix.exs`:
89
94
@@ -96,16 +101,17 @@ def deps do
96
101
end
97
102
```
98
103
99
-
Now let's change `config/config.exs` to configure `bun` to use
100
-
`assets/js/app.js` as an entry point and write to `priv/static/assets`:
104
+
Now let's change `config/config.exs` to configure `bun` to add two commands,
105
+
one to install dependencies and another to build `assets/js/app.js` as an
0 commit comments