Skip to content

Instantly share code, notes, and snippets.

@yorickvP
Last active May 29, 2020 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorickvP/a3b4cbea87fa8f528d96062e0013252b to your computer and use it in GitHub Desktop.
Save yorickvP/a3b4cbea87fa8f528d96062e0013252b to your computer and use it in GitHub Desktop.
nix-reason-react-starter-build
let
pkgs = import <nixpkgs> {};
nix-npm-buildpackage = pkgs.callPackage (builtins.fetchTarball "https://github.com/yorickvp/nix-npm-buildpackage/archive/yorickvp/packageOverrides.tar.gz") {};
in
nix-npm-buildpackage.buildNpmPackage {
src = ./.;
installJavascript = false;
packageOverrides = {
bs-platform = pkgs.bs-platform;
};
}
{
"name": "reason-react-starter",
"version": "0.1.0",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w -ws _ ",
"clean": "bsb -clean-world",
"webpack": "webpack -w",
"webpack:production": "NODE_ENV=production webpack",
"server": "webpack-dev-server",
"test": "echo \"Error: no test specified\" && exit 1",
"prepublish": "bsb -make-world && NODE_ENV=production webpack"
},
"keywords": [
"BuckleScript",
"ReasonReact",
"reason-react"
],
"files": ["/build"],
"author": "",
"license": "MIT",
"dependencies": {
},
"devDependencies": {
"@glennsl/bs-json": "^5.0.2",
"bs-fetch": "^0.5.2",
"bulma": "^0.8.2",
"moment": "^2.26.0",
"moment-locales-webpack-plugin": "^1.2.0",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"reason-react": ">=0.7.1",
"bs-platform": "^7.3.2",
"webpack": "^4.0.1",
"webpack-cli": "^3.1.1",
"webpack-dev-server": "^3.1.8",
"html-webpack-plugin": "^3.2.0",
"style-loader": "^1.0.0",
"css-loader": "^3.2.0"
}
}
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
yarn
bs-platform
ocamlPackages.reason
];
shellHook = ''
mkdir -p node_modules
rm -rf node_modules/bs-platform
ln -s ${pkgs.bs-platform} node_modules/bs-platform
echo "run npm install && npm start, run npm run server in other term"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment