Created
October 15, 2019 02:21
-
-
Save mifas/27938a71da40ada0c50654511e97bdae to your computer and use it in GitHub Desktop.
Clean create-react-app default code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
alias craclean="_craclean ." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment