Skip to content

Commit

Permalink
📝 Document the additional transformations bundling will perform.
Browse files Browse the repository at this point in the history
  • Loading branch information
hayleigh-dot-dev committed Jul 20, 2024
1 parent 47f9fe0 commit 9f6d9ab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ and options. Here's a brief overview of the commands provided by Lustre's dev to
it detects a `tailwind.config.js` in your project but will not download it
automatically. Be sure to add the following to your root level `index.html`

`<link rel="stylesheet" type="text/css" href="./priv/static/my_app.css" />`
`<link rel="stylesheet" type="text/css" href="/priv/static/my_app.css" />`

- `lustre/dev build` - Commands to build different kinds of Lustre application.
These commands go beyond just running `gleam build` and handle features like
Expand Down
20 changes: 20 additions & 0 deletions src/lustre/dev.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
//// `App(Nil, model, msg)` then Lustre will automatically generate some boilerplate
//// to mount the app onto an element with the id `"app"` and start it.
////
//// In addition to bundling, Lustre's dev tools will apply the following
//// transformations to the output:
////
//// - FFI modules will be copied into Gleam's build directory even if they are
//// not directly under the `src/` directory. This is a temporary patch until
//// the Gleam compiler supports this itself.
////
//// - FFI modules that have *relative* imports to `*.gleam` modules will have
//// their imports rewritten to point to the compiled `*.mjs` files instead.
////
//// Flags:
////
//// - `--minify` - Reduce the size of the output bundle by removing whitespace and
Expand Down Expand Up @@ -108,6 +118,16 @@
//// name is not important but in cases where multiple functions in a module fit this
//// type, the _first_ one will be used.
////
//// In addition to bundling, Lustre's dev tools will apply the following
//// transformations to the output:
////
//// - FFI modules will be copied into Gleam's build directory even if they are
//// not directly under the `src/` directory. This is a temporary patch until
//// the Gleam compiler supports this itself.
////
//// - FFI modules that have *relative* imports to `*.gleam` modules will have
//// their imports rewritten to point to the compiled `*.mjs` files instead.
////
//// Arguments:
////
//// - `<module_path>` - The path to the Lustre component you want to bundle. This should
Expand Down

0 comments on commit 9f6d9ab

Please sign in to comment.