Skip to content

Instantly share code, notes, and snippets.

@jonathanconway
Last active May 13, 2018 13:47
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 jonathanconway/15271dda82b1de39e12eb938ac4a6e8d to your computer and use it in GitHub Desktop.
Save jonathanconway/15271dda82b1de39e12eb938ac4a6e8d to your computer and use it in GitHub Desktop.
Minimalist create-react-app. Just enough to write a failing unit-test. πŸ”΄ βœ…
################################################################################
#
# 1. Save this file to /usr/local/bin
#
# 2. To make it executable: chmod u+x /usr/local/bin/create-react-app-minimal.sh
#
# 3. To create your app: create-react-app-minimal {app-name}
#
# 4. In your package.json, change this line:
# "test": ...
# to this:
# "test": "jest"
#
# 5. And append this block:
# ,
# "babel": {
# "presets": [
# "env",
# "react"
# ],
# "plugins": [
# "transform-class-properties",
# "transform-object-rest-spread",
# "transform-runtime"
# ]
# }
#
################################################################################
mkdir $1
cd $1
npm init -y
npm install \
babel-loader@7.1.2 \
babel-plugin-transform-class-properties@6.24.1 \
babel-plugin-transform-object-rest-spread@6.26.0 \
babel-plugin-transform-runtime@6.23.0 \
babel-preset-env@1.6.0 \
babel-preset-react6.24.1 \
enzyme@3.1.0 \
html-webpack-plugin@2.30.1 \
jest@20.0.4 \
react-test-renderer@16.0.0 \
webpack@3.6.0 \
webpack-dev-server@2.9.1 \
--save-dev
npm install \
react@16.0.0 \
react-dom@16.0.0 \
--save
@MichaelDimmitt
Copy link

MichaelDimmitt commented Apr 15, 2018

thank you for posting a minimalist version.
I am spending my day playing around with this as a base.

I think you have a typo. @jonathanconway

not working: babel-preset-react6.24.1
npm ERR! 404 Not Found: babel-preset-react6.24.1@latest

working: babel-preset-react@6.24.1

Thoughts?

@jonathanconway
Copy link
Author

Thanks for your feedback, @MichaelDimmitt. I'll see if I can resolve this. I also want to try and avoid spelling out the version numbers if possible, so that it picks up the latest version instead. Will work on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment