我在将引导程序添加到我的节点项目时遇到了一些问题。我通过 bower 安装了 bootstrap-sass-official,然后添加了 gulp 任务来编译 bootstrap。
我运行了直接从控制台编译引导程序的任务,它成功完成了。我的 gulpfile.coffee
gulp = require 'gulp'
$ = (require 'gulp-load-plugins')()
livereload = require 'gulp-livereload'
nodemon = require 'gulp-nodemon'
concat = require 'gulp-concat'
express = require 'express'
path = require 'path'
sass = require 'gulp-ruby-sass'
app = express()
gulp.task 'bootstrap-sass', =>
gulp.src './bower_components/bootstrap-sass-official/assets/stylesheets/**/*.scss'
.pipe $.plumber()
.pipe $.sass({
outputStyle: 'compressed'
sourceComments: 'map'
includePaths : ['./bower_components/bootstrap-sass-official/assets/stylesheets']
})
.on 'error', (err) =>
console.log err
.pipe gulp.dest 'dist/stylesheets/bootstrap'
gulp.task 'compass', =>
gulp.src './src/stylesheets/*.sass'
.pipe $.plumber()
.pipe $.compass {
css: 'dist/stylesheets'
sass: 'src/stylesheets'
}
.pipe gulp.dest 'dist/stylesheets'
# .pipe livereload()
gulp.task 'coffee', =>
gulp.src 'src/scripts/main.coffee', {read: false}
.pipe $.plumber()
.pipe $.browserify {
debug: true
insertGlobals: false
transform: ['coffeeify']
extensions: ['.coffee']
}
.pipe $.rename 'app.js'
.pipe gulp.dest 'dist/scripts'
.pipe livereload()
gulp.task 'images', =>
gulp.src './src/images/**/*'
.pipe gulp.dest './dist/images/'
.pipe livereload()
gulp.task 'templates', =>
gulp.src 'src/*.jade'
.pipe $.plumber()
.pipe $.jade {
pretty: true
}
.pipe gulp.dest 'dist/'
.pipe livereload()
gulp.task 'express', =>
app.use express.static(path.resolve './dist')
app.listen 1337
$.util.log 'Listening on port: 1337'
gulp.task 'watch', =>
livereload.listen()
gulp.watch 'src/stylesheets/*.sass', ['compass']
gulp.watch 'src/scripts/*.coffee', ['coffee']
gulp.watch 'src/*.jade', ['templates']
gulp.watch './src/images/**/*', ['images']
$.notify {message: "Reload"}
gulp.task 'default', ['images', 'watch', 'express', 'demon']
gulp.task 'demon', =>
nodemon {
script: 'dist/scripts/app.js'
env: {'NODE_ENV': 'development'}
nodeArgs: ['--debug=9999']
}
你知道如何解决这个问题吗?