Skip to content

Commit

Permalink
Added sass support
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Jun 7, 2015
1 parent 537d36f commit f1ee028
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
main.js
style.css
22 changes: 20 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ var watchify = require('watchify');
var reactify = require('reactify');
var notifier = require('node-notifier');
var server = require('gulp-server-livereload');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var watch = require('gulp-watch');

var notify = function(error) {
var message = 'In: ';
Expand Down Expand Up @@ -58,11 +61,26 @@ gulp.task('serve', function(done) {
livereload: {
enable: true,
filter: function(filePath, cb) {
cb( /main.js/.test(filePath) )
if(/main.js/.test(filePath)) {
cb(true)
} else if(/style.css/.test(filePath)){
cb(true)
}
}
},
open: true
}));
});

gulp.task('default', ['build', 'serve']);
gulp.task('sass', function () {
gulp.src('./sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(concat('style.css'))
.pipe(gulp.dest('./'));
});

gulp.task('default', ['build', 'serve', 'sass', 'watch']);

gulp.task('watch', function () {
gulp.watch('./sass/**/*.scss', ['sass']);
});
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"gulp": "^3.8.11",
"gulp-concat": "^2.5.2",
"gulp-react": "^3.0.1",
"gulp-sass": "^2.0.1",
"gulp-server-livereload": "^1.3.0",
"gulp-util": "^3.0.4",
"gulp-watch": "^4.2.4",
"node-notifier": "^4.2.1",
"react": "^0.13.1",
"reactify": "^1.1.0",
Expand Down
3 changes: 3 additions & 0 deletions sass/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.black {
color: black
}
2 changes: 1 addition & 1 deletion src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var React = require('react');

var Hello = React.createClass({
render: function() {
return <h1>
return <h1 className="red">
Hello!
</h1>
}
Expand Down

0 comments on commit f1ee028

Please sign in to comment.