ReactJS project quick start. Created for NEWBIE
.
Use command
git clone https://github.com/williele/react-starter.git
or download from GitHub
Delete folder .git
User command npm install
- Inital and commit
git init
git add .
git commit -m "Initial Commit"
- Push to your repository
git remote add origin <your-github-repository-url>
git push -u --force origin master
# Development
npm run build:dev
# Production
npm run build:prod
# Development
npm run watch:dev
# Production
npm run watch:prod
npm start
react-starter/
├── config/
| ├── webpack.common.js * Webpack common config
| ├── webpack.dev.js * Webpack development config
| └── webpack.prod.js * Webpack production config
|
├── src/ * Source code where compile to javascript
| ├── app/ * WebApp: folder
| | ├── components/ * Inital Components folder
| | | └── title.component.jsx * Simple example component
| | |
| | ├── pages/ * Initial Pages folder
| | | ├── another.page.jsx * Simple example page component
| | | └── home.page.jsx * Simple example page component
| | |
| | └── app.component.jsx * App main component
| |
| ├── index.html * Where to generate the index page
| ├── main.jsx * The entry file of app
| └── styles.scss * Where to compile to index style file
|
├── alias.json * Where for quick define resolve.alias
├── config.json * Where to simply setting project config
└── package.json * Where npm uses to manage dependencies
react * A JavaScript library for building user interfaces
react-dom * This package serves as the entry point of the DOM-related rendering paths
react-router-dom * Collection of navigational components that compose declaratively with your application
webpack * Build tool for javascript
webpack-cli * Webpack command package
webpack-dev-server * Live server compile and review on localhost for webpack
webpack-merge * Merge webpack configure
babel-core * ES6 Compiler for javascript
babel-loader * Babel loader for webpack
babel-plugin-transform-react-jsx * Babel plugin which transform jsx dom to react javascript
style-loader * Adds CSS to the DOM by injecting a <style> tag
css-loader * Css loader
sass-loader * Loads a SASS/SCSS file and compiles it to CSS
node-loader * Library provides binding for Node.js to LibSass
file-loader * Instructs webpack to emit the required object as file and to return its public URL
url-loader * Loads files as `base64` encoded URL
clean-webpack-plugin * Remove build directory before build
html-webpack-plugin * Generate HTML files to serve webpack bundles
base-href-webpack-plugin * Inserting base href tag in head block
Create aliases to import
or require
certain modules more easily. You can quickly set up alias tree for webpack in alias.json
file. The root directory of alias is src
. Learn more at Official Document
Simply configure project parameter for building and developing in config.json
file.
{
"outputDir": "dist", * Build directory
"devPort": 4200 * Development server port
}