1.0.11 • Published 7 months ago
cra-template-sulli v1.0.11
Sulli's CRA Template
My 1st attempt (fingers crossed) Inspired by
What's up?
It would be nice to have my own app template, where I can create a new application with my opionated style. Enabling me to create as many of these as I want, quickly and constently.
Of course I could achieve this by cloning an existing repository; however, I would then have to deal with emancipating this into my own repository.
Blah blah blah! Boooring! Life is too short for this to be an acceptable practice!!!
Surely there is a better way :)
This is whats up
I can create my app template based on an existing app.
Say it ain't so
- Create a folder named
cra-template-<template-name>
- Must be prefixed with
cra-template
to be considered a template
- Must be prefixed with
- Add the following
- package.json
name
must be prefixed withcra-template
- template.json
- This is where you add all your specific dependencies
- Structure
- ./template
- This is where you will place your existing app
- ./template/gitignore
- Remove the '.'
- package.json
- Upload to NPM packages
- Local testing
- Login into NPM (personal npm account)
- Command:
npm login
- type in user/pass/email
- Command:
- Upload to NPM
- Command:
npm publish
- Should show in your NPM registry (check it)
- Command:
- Login into NPM (personal npm account)
- Local testing
- Create an app based on the template
- Command:
npm create-react-app my-app --template <template-name>
- Command:
Helpful Commands
Goal | Command |
---|---|
Build your app | npm create-react-app cra-template-sulli |
Publish your template | npm install |
Generate from your template | npm publish |
[]