-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(preamble): add the preamble before the
// Generated
comment (#574)
* fix(preamble): add the preamble before the `// Generated` comment * add missing unstaged test
- Loading branch information
1 parent
f37a015
commit cf803f3
Showing
6 changed files
with
44 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Generated by Melange | ||
"use client"; | ||
// Generated by Melange | ||
'use strict'; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Demonstrate usage of `--preamble` | ||
|
||
$ . ./setup.sh | ||
$ cat > x.ml <<EOF | ||
> let x = 1 | ||
> EOF | ||
$ melc x.ml --preamble '"use client";' | ||
"use client"; | ||
// Generated by Melange | ||
'use strict'; | ||
var x = 1; | ||
exports.x = x; | ||
/* No side effect */ | ||
$ cat > x.ml <<EOF | ||
> [@@@bs.config { flags = [| "--preamble"; "\"use client\";" |] }] | ||
> let x = 1 | ||
> EOF | ||
$ melc x.ml | ||
"use client"; | ||
// Generated by Melange | ||
'use strict'; | ||
var x = 1; | ||
exports.x = x; | ||
/* No side effect */ | ||