Skip to content

Instantly share code, notes, and snippets.

@mifas
Created January 14, 2019 10:07
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 mifas/8839c42e82d986dc9264927d04c3214d to your computer and use it in GitHub Desktop.
Save mifas/8839c42e82d986dc9264927d04c3214d to your computer and use it in GitHub Desktop.
Create React App default code cleanup
function craclean(){
rm -rf $1/src/App.js $1/src/App.css $1/src/App.test.js $1/src/index.css $1/src/logo.svg
cat << EOS > $1/src/App.js
import React, { Component } from 'react'
export default class App extends Component {
render() {
return (
<div>
App
</div>
)
}
}
EOS
cat << EOS > $1/src/index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
serviceWorker.unregister();
EOS
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment