[Flux] 1. Development Environment Setup

时间:2022-09-28 22:21:32

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:

[Flux] 1. Development Environment Setup

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. &lbrack;React Fundamentals&rsqb; 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&period;

    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 &lpar;Golang&rpar; – 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 &period;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. C&num;开发微信门户及应用&lpar;6&rpar;--微信门户菜单的管理操作

    前面几篇继续了我自己对于C#开发微信门户及应用的技术探索和相关的经验总结,继续探索微信API并分享相关的技术,一方面是为了和大家对这方面进行互动沟通,另一方面也是专心做好微信应用的底层技术开发,把基础 ...

  2. C语言版flappy bird黑白框游戏

    在此记录下本人在大一暑假,2014.6~8这段时间复习C语言,随手编的一个模仿之前很火热的小游戏----flappy bird.代码bug基本被我找光了,如果有哪位兄弟找到其他的就帮我留言下吧,谢谢了 ...

  3. hdwiki 编码规范

    编码规范         命名规范 1.1.主要的目录 control 里面是控制类 ,前台命名为something.php,则后台对应的是admin_+前台名称,名称应选有意义的英文单词,例如 前台 ...

  4. ReactNative遇到的一些坑

    1. 如果通过一个url进行下载上传操作,这个url中包含有中文的话,一定要记得将这个url转为URLEncode编码. 如: encodeURI('http://test/有中文.doc'); 2. ...

  5. 《Qt on Android核心编程》介绍

    <Qt on Android核心编程>最终尘埃落定.付梓印刷了. 2014-11-02更新:china-pub的预售链接出来了.折扣非常低哦. 封面 看看封面的效果吧,历经几版,最终就成了 ...

  6. &lbrack;转&rsqb;Nginx基本功能极速入门

    原文链接:Nginx基本功能极速入门 | 叉叉哥的BLOG 本文主要介绍一些Nginx的最基本功能以及简单配置,但不包括Nginx的安装部署以及实现原理.废话不多,直接开始. 1.静态HTTP服务器 ...

  7. Java两种方法实现循环报数

    问题描述: 十个猴子围成一圈选大王,依次1-3 循环报数,报到3 的猴子被淘汰,直到最后一只猴子成为大王.问,哪只猴子最后能成为大王? 方法一:Java链表 public class TestAll ...

  8. C&num;匿名类型和动态解析减少定义传输类模板

    C#作为强类型语言,在序列化和反序列化(json)场景中对字符串解析常常需要定义强类型模板,造成编码上的繁琐.其实可以使用匿名类型和动态解析减少json序列化时候的数据模板定义: string a = ...

  9. date&period;getTime&lpar;&rpar;

    Date date = new Date(); System.out.println(date.getTime()); 输出结果是1210745780625 编译时间当时时间大概是2008年5.14好 ...

  10. mysql 免安装版

    通过MySQL安装程序(.msi文件)来安装虽然简洁高效,但不够灵活,所以我们这里介绍免安装版. 1.  下载: 进入官网-->Downloads-->Community(社区版)--&g ...