Commit 61582433 authored by Tony Kovanen's avatar Tony Kovanen Committed by Tim Neutkens

with-reasonml: better setup (#4218)

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.
parent f378448b
bs bs
.merlin .merlin
lib/ lib/
*.bs.js
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
"sources": ["components", "pages"], "sources": ["components", "pages"],
"bs-dependencies": ["reason-react", "bs-next"], "bs-dependencies": ["reason-react", "bs-next"],
"reason": { "react-jsx": 2 }, "reason": { "react-jsx": 2 },
"package-specs": ["commonjs"], "package-specs": {
"module": "commonjs",
"in-source": true
},
"suffix": ".bs.js",
"bsc-flags": [ "bsc-flags": [
"-bs-super-errors" "-bs-super-errors"
], ],
......
module.exports = {
pageExtensions: ['jsx', 'js', 'bs.js']
}
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
"name": "with-reasonml", "name": "with-reasonml",
"version": "1.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"dev": "bsb -clean-world -make-world && next dev lib/js", "dev": "concurrently \"bsb -clean-world -make-world -w\" \"next dev\"",
"build": "bsb -clean-world -make-world && next build lib/js", "build": "bsb -clean-world -make-world && next build",
"start": "next start lib/js" "start": "next start"
}, },
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment