Install packages:

{
"name": "reactflux",
"version": "1.0.0",
"description": "",
"main": "dist/js/main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "0.13.3",
"react-router-component": "0.26.0",
"vinyl-source-stream": "1.1.0"
},
"devDependencies": {
"browserify": "11.0.1",
"del": "2.0.0",
"gulp": "3.9.0",
"gulp-plumber": "*",
"reactify": "1.1.1",
"run-sequence": "1.1.2"
}
}

Automation with Gulp:

/**
* Created by Answer1215 on 9/3/2015.
*/ var gulp = require('gulp'),
browserify = require('browserify'),
reactify = require('reactify'),
del = require('del'),
plumber = require('gulp-plumber'),
runSequence = require('run-sequence'),
source = require('vinyl-source-stream'); gulp.task('browserify', function () {
browserify('./src/js/main.js')
.transform('reactify')
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('dist/js'));
}); gulp.task('copy', function () {
gulp.src('./src/index.html')
.pipe(gulp.dest('dist'));
gulp.src('./src/assets/**/*.*')
.pipe(gulp.dest('dist/assets'));
}); gulp.task('watch', function() {
gulp.watch('./src/**/*.*', ['browserify', 'copy']);
}); gulp.task('clean', function(callback) {
return del(['./dist']);
}); gulp.task('default', function (callback) {
runSequence('clean', ['browserify', 'copy', 'watch'], callback);
});

Structure:

main.js:

var App = require('./components/app'),
React = require('react'); React.render(<App />, document.getElementById('main'));

src/components/app.js:

var React = require('react');

var App = React.createClass({
render: function(){
return (<h1> My App</h1>);
}
}); module.exports = App;

[Flux] 1. Development Environment Setup的更多相关文章

  1. [React Fundamentals] Development Environment Setup

    In this lesson we'll setup a simple build process for converting our ES6 React components into ES5 u ...

  2. Azure Sphere Development Environment Setup

    1. Visual Studio 目前,Visual Studio 2017/2019支持Azure Sphere开发,后续,微软会加入Visual Studio Code的支持.以Visual St ...

  3. Setup iOS Development Environment.

    Setup iOS Development Environment Install XCode and check-out source code from SVN XCode Please find ...

  4. The Google Test and Development Environment (持续更新)

    最近Google Testing Blog上开始连载The Google Test and Development Environment(Google的测试和开发环境),因为blogspot被墙,我 ...

  5. Programming in Go (Golang) – Setting up a Mac OS X Development Environment

    http://www.distilnetworks.com/setup-go-golang-ide-for-mac-os-x/#.V1Byrf50yM8 Programming in Go (Gola ...

  6. How to set up Dynamics CRM 2011 development environment

    Recently I have been starting to learn Microsoft Dynamics CRM 2011 about implement plugin and workfl ...

  7. Struts 2 - Environment Setup

    Our first task is to get a minimal Struts 2 application running. This chapter will guide you on how ...

  8. Create A .NET Core Development Environment Using Visual Studio Code

    https://www.c-sharpcorner.com/article/create-a-net-core-development-environment-using-visual-studio- ...

  9. Install Qualcomm Development Environment

    安裝 Android Development Environment http://www.cnblogs.com/youchihwang/p/6645880.html 除了上述還得安裝, sudo ...

随机推荐

  1. ip输入框键入.或者合法数字自动选择下一个输入框效果

    <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="utf-8& ...

  2. strtotime 的几点不同

    在php里面,strtotime()有点比较特殊,date函数也有点问题 if ( date(1,time()) == "Monday")    //似乎 date(1,time( ...

  3. svn服务器时间与本地时间不同步解决

    在用svn的时候,由于svn的时间与本地不同步,导致每次看log总是需要对时间. 今天修改了svn服务器时间与本地同步.只需要修改svn服务器时间与本地时间相同即可,但要主要修改时区,不然会出现时间又 ...

  4. 为什么selenium定位不到元素

    在做web应用的自动化测试时,定位元素是必不可少的,这个过程经常会碰到定位不到元素的情况,一般可以从以下几个方面着手解决: 1.Frame/Iframe原因定位不到元素: 这个是最常见的原因,首先要理 ...

  5. C#Lambda表达式学习日记

    Lambda表达式只是用更简单的方式来写匿名方法,彻底简化了对.NET委托类型的使用. 现在,如果我们要使用泛型 List<> 的 FindAll() 方法,当你从一个集合去提取子集时,可 ...

  6. [BZOJ 2178] 圆的面积并 【Simpson积分】

    题目链接:BZOJ - 2178 题目分析 用Simpson积分,将圆按照 x 坐标分成连续的一些段,分别用 Simpson 求. 注意:1)Eps要设成 1e-13  2)要去掉被其他圆包含的圆. ...

  7. 通过 DevOps 整合开发和应用安全管道

    [编者按]作者 Aaron Volkmann 是 CERT Division 高级研究员,通过提出了一种集成安全系统到 CI/CD 的方法,让机构保持快速部署到生产环境能力的同时,也大幅度降低安全隐患 ...

  8. Werkzeug教程

    http://chaoxz2005.blog.163.com/blog/static/15036542012863405266/ http://www.dajo.com.cn/a/boke/pytho ...

  9. Android开源项目发现--- 工具类图片缓存篇(持续更新)

    1. Android-Universal-Image-Loader 图片缓存 目前使用最广泛的图片缓存,支持主流图片缓存的绝大多数特性. 项目地址:https://github.com/nostra1 ...

  10. ECC内存

    ECC内存,即应用了能够实现错误检查和纠正技术(ECC)的内存条.一般多应用在服务器及图形工作站上,这将使整个电脑系统在工作时更趋于安全稳定.ECC是“Error Checking and Corre ...