jtberglund / gatsby-plugin-reason Goto Github PK
View Code? Open in Web Editor NEWReasonML with Gatsby!
License: MIT License
ReasonML with Gatsby!
License: MIT License
I am not sure if I will have any spare time to contribute to this project, but I may rely on it soon.
Can you note any issues that I may encounter which do not already have github issues tracking the problem?
This code
let text = ReasonReact.string;
[@react.component]
let make = () => {
<div>
<h1> (text("404 Not Found")) </h1>
<p>
(text("You just hit a route that doesn't exist... the sadness."))
</p>
</div>
};
React.setDisplayName(make, "404");
Will provide the following error when you try to access http://localhost:8000/404
:
Using the current latest version of Gatsby (1.9), I am not able to compile either .ml or .re files after following the setup guide in the README.md.
I understand this is a vague issue, but do you have any ideas as to why? Thanks
Followed the steps:
https://www.gatsbyjs.org/packages/gatsby-plugin-reason/
However .re files are only compiled if i import them, is there any way for me to have a watcher for re files so that they are automatically compiled on save without importing them in other modules?
package.json
"bs-platform": "^5.0.4",
"gatsby-plugin-reason": "^2.0.1"
bsconfig.json
{
"name": "wunschcoach-ssr",
"reason": { "react-jsx": 2 },
"bs-dependencies": ["reason-react"],
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"package-specs": {
"module": "commonjs"
},
"suffix": ".bs.js",
"refmt": 3
}
gatsby-config.js
plugins: [
`gatsby-plugin-react-helmet`,
'gatsby-plugin-root-import',
`gatsby-plugin-sass`,
`gatsby-plugin-catch-links`,
`gatsby-plugin-netlify-cms`,
`gatsby-plugin-reason`,
`gatsby-plugin-remove-trailing-slashes`,
{
resolve: `gatsby-plugin-page-creator`,
options: {
path: `${__dirname}/src/gatsby/pages`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: 'blog-posts',
path: `${__dirname}/content/posts/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: 'pages',
path: `${__dirname}/content/pages`,
},
},
`gatsby-transformer-remark`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
},
},
{
resolve: 'gatsby-plugin-react-svg',
options: {
rule: {
include: `${__dirname}/src/svgs/`,
},
},
},
{
resolve: 'gatsby-plugin-root-import',
options: {
src: path.join(__dirname, 'src'),
components: path.join(__dirname, 'src/components'),
constants: path.join(__dirname, 'src/constants'),
},
},
{
resolve: `gatsby-plugin-create-client-paths`,
options: { prefixes: [`/gatsby/app/*`] },
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
Creating a page component with the name 404
eg.
let component = ReasonReact.statelessComponent("404");
correctly creates a page called 404, (you can navigate to it at localhost:8000/404
).
However, Gatsby does not recognize this page as the actual 404 page that should be displayed when the user navigates to a page that does not exist.
Upon navigating to a non-existent page you simply see the generic message "Not Found" instead of the 404 page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.