Skip to content

Commit

Permalink
Replace 'official' with 'more reliable'...
Browse files Browse the repository at this point in the history
...when comparing `mel.raw` with `external` for importing frontend assets
  • Loading branch information
feihong committed Jan 2, 2024
1 parent 096fb4c commit 41945e1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/styling-with-css/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,11 @@ Finally, add a `mel.raw` extension node at the top of `Order.re`:

This solution works well for our current build configuration, but falls apart if
we change the `module_systems` field of the `melange.emit` stanza from `es6` to
`commonjs`. This results in a subtle runtime error caused by the fact
that CommonJS uses `require` instead of `import` to import modules.
`commonjs`. This results in a subtle runtime error caused by CommonJS needing
`require` instead of `import` to import modules.

The `mel.raw` extension node is unsafe, but it is still useful for prototyping.
Fortunately, Melange provides an official and more reliable way to import
frontend assets.
Fortunately, Melange provides a more reliable way to import frontend assets.

## Import using `external`

Expand Down

0 comments on commit 41945e1

Please sign in to comment.