Skip to content

Commit b8fda42

Browse files
committed
added gulp items and scaffolding react-redux
1 parent d22dc58 commit b8fda42

File tree

7 files changed

+82
-0
lines changed

7 files changed

+82
-0
lines changed

.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015", "stage-0", "react"]
3+
}

client/actions/index.js

Whitespace-only changes.

client/components/app.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React, { Component } from 'react';
2+
3+
export default class App extends Component {
4+
render() {
5+
return (
6+
<div>
7+
</div>
8+
);
9+
}

client/index.js

Whitespace-only changes.

client/reducers/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { combineReducers } from 'redux';
2+
3+
const rootReducer = combineReducers({
4+
5+
});
6+
7+
export default rootReducer;

gulpfile.js

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'use strict';
2+
3+
const gulp = require('gulp');
4+
const eslint = require('gulp-eslint');
5+
const webpack = require('webpack-stream');
6+
const sass = require('gulp-sass');
7+
// const Server = require('karma').Server;
8+
9+
const scripts = ['index.js', 'lib/*.js', 'test/**/*.js', 'models/*.js',
10+
'routes/*.js', 'client/**/*.js?(x)', '!test/client/test_bundle.js'];
11+
const clientScripts = ['client/**/*.js?(x)'];
12+
const staticFiles = ['client/**/*.html'];
13+
const clientTests = ['test/client/*.js', '!test/client/test_bundle.js'];
14+
15+
gulp.task('static:dev', () => {
16+
gulp.src(staticFiles, { 'base': 'client' })
17+
.pipe(gulp.dest('build/'));
18+
});
19+
20+
gulp.task('sass:dev', () => {
21+
gulp.src('client/sass/main.sass')
22+
.pipe(sass().on('error', sass.logError))
23+
.pipe(gulp.dest('./build'));
24+
});
25+
26+
gulp.task('build:dev', () => {
27+
webpack({
28+
entry: ['./client/index.js'],
29+
output: {
30+
filename: 'bundle.js'
31+
},
32+
module: {
33+
loaders: [
34+
{
35+
test: /\.jsx?$/,
36+
exclude: /node_modules/,
37+
loader: 'babel-loader'
38+
}
39+
]
40+
},
41+
devtool: 'source-map'
42+
})
43+
.pipe(gulp.dest('dist/'));
44+
});
45+
46+
gulp.task('lint', () => {
47+
return gulp.src(scripts)
48+
.pipe(eslint())
49+
.pipe(eslint.format());
50+
});
51+
52+
gulp.task('watch', () => {
53+
gulp.watch(scripts, ['lint']);
54+
gulp.watch(clientScripts, ['build:dev']);
55+
gulp.watch(staticFiles, ['static:dev']);
56+
// gulp.watch(clientTests, ['test:client']);
57+
gulp.watch('client/sass/*.sass', ['sass:dev']);
58+
});
59+
60+
gulp.task('dev', ['lint', 'static:dev', 'build:dev', 'sass:dev']);
61+
62+
gulp.task('default', ['watch', 'dev']);

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"babel-preset-es2015": "^6.6.0",
2828
"babel-preset-react": "^6.5.0",
2929
"babel-preset-stage-0": "^6.5.0",
30+
"eslint": "^2.8.0",
3031
"eslint-plugin-react": "^4.3.0",
3132
"gulp": "^3.9.1",
3233
"gulp-eslint": "^2.0.0",

0 commit comments

Comments
 (0)