Skip to content

Commit

Permalink
with-reasonml: better setup (#4218)
Browse files Browse the repository at this point in the history
With this setup we're compiling the .re/.ml files directly to source
directories with a .bs.js extension, and enabling next.js to pick up
that extension for pages.
  • Loading branch information
rase- authored and timneutkens committed Apr 27, 2018
1 parent f378448 commit 6158243
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/with-reasonml/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bs
.merlin
lib/
*.bs.js
6 changes: 5 additions & 1 deletion examples/with-reasonml/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"sources": ["components", "pages"],
"bs-dependencies": ["reason-react", "bs-next"],
"reason": { "react-jsx": 2 },
"package-specs": ["commonjs"],
"package-specs": {
"module": "commonjs",
"in-source": true
},
"suffix": ".bs.js",
"bsc-flags": [
"-bs-super-errors"
],
Expand Down
3 changes: 3 additions & 0 deletions examples/with-reasonml/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
pageExtensions: ['jsx', 'js', 'bs.js']
}
6 changes: 3 additions & 3 deletions examples/with-reasonml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "with-reasonml",
"version": "1.0.0",
"scripts": {
"dev": "bsb -clean-world -make-world && next dev lib/js",
"build": "bsb -clean-world -make-world && next build lib/js",
"start": "next start lib/js"
"dev": "concurrently \"bsb -clean-world -make-world -w\" \"next dev\"",
"build": "bsb -clean-world -make-world && next build",
"start": "next start"
},
"license": "ISC",
"dependencies": {
Expand Down

0 comments on commit 6158243

Please sign in to comment.