New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

generator-buildreact

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-buildreact

基于react+webpack的项目生成器

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

基于ract+webpack的前端项目目录快速生成器

开始安装

首先确保自己已经安装了nodejs

然后安装yeoman

npm install -g yo

然后安装脚手架

npm install -g generator-reactpackage

在自己的空项目中运行:

yo reactpackage

然后就会在此目录下生成以下目录结构:

├── data
│   └── test.json
├── src
│   ├── components
│   │   └── App.js
│   ├── images
│   │   └── yeoman.png
│   ├── styles
│   │   └── app.scss
│   ├── vendor
│   │   └── jquery.js
│   ├── views
│   │   └── home.html
├── node_modules
├── index.html
├── package.json
└── webpack.config.js

然后使用命令启动服务:

npm run dev

默认监听端口是8888,所以在浏览器输入 http://localhost:8888 就能看到效果了。

注意:如果执行上述命令提示错误:Error: getaddrinfo ENOTFOUND localhost,在host文件里面添加127.0.0.1 localhost即可。

开发完成之后,对项目进行打包,使用命令:

npm run build

Keywords

yeoman-generator

FAQs

Package last updated on 25 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts