1.0.9 • Published 9 years ago

react-webpack-example v1.0.9

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

React Webpack example

Webpack打包React的脚手架,可自动识别 ./src 目录下的 .js 文件作为入口。区分多个环境,已正确配置热加载

支持的功能

  1. 自动适配多入口
  2. 自动写入 js css文件到 html
  3. 支持less
  4. 本地Server开发
  5. 热加载代码
  6. 区分开发和生产环境

使用

git clone https://github.com/jun-lu/react-webpack-example.git
cd react-webpack-example
npm install
npm start //访问 http://127.0.0.1:8080/index.html

目录

-build 
-src
server.js
webpack.config.js

服务端口

server.js 中修改 port 变量

构建

webpack.config.js

//源文件目录
var rootPath = "./src";
//发布文件目录
var distPath = "./build";
  • cdn
var daily_publicPath = "http://daily.yuantutech.com";
var dist_publicPath = "http://s.yuantutech.com";

命令

npm start //本地开发
npm run dev //测试包 不压缩代码 使用  daily_publicPath 域名
npm run dist //线上包 压缩代码 使用  dist_publicPath 域名
1.0.9

9 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago