ReactJS 学习资源
Category: /knowledge /front_endTags: front_end
资源列表
Install
sudo apt install npm nodejs
# method 1, go to workspace folder
# create an app folder by youself
mkdir reactApp; cd reactApp
npm init -y
npm install webpack --save
npm install webpack-dev-server --save
npm install react --save
# method 2, go to workspace folder
npm install -g create-react-app
create-react-app $project_name
cd $project_name
npm start
# the app is running at port 3000 by default
Useful commands
-
Start the dev server:
npm start
-
Compile to static files for production:
npm run build
-
Start the test runner:
npm test
-
Remove this tool and copies build dependencies, conf files and scripts into the app dir:
npm run eject