问题
I have the code:
var gulp = require('gulp');
var webpack = require('webpack-stream');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
gulp.task('webpack', function() {
gulp.src('*/lib/*.coffee', { base: '.' })
.pipe(coffee({ bare: true }))
.pipe(concat('app.js'))
.pipe(webpack())
.pipe(gulp.dest('.'));
});
However, it doesn't work, when it reaches webpack()
. How can I make it so that the content passed from concat()
to webpack()
works successfully?
I also assume that if I removed the concat()
pipe, and went straight from coffee()
to webpack()
, then I'd end up with multiple files processed by webpack()
rather than a single one, right?
I tried using coffee-loader
for Webpack, but for some reason it outputs content with bare: false
(when I look at the output file), even though in the actual package, it appears that it's hardcoded to output with bare: true
. So that's why I'm using gulp-coffee
instead.
来源:https://stackoverflow.com/questions/38253175/pass-gulp-sources-to-gulp-coffee-gulp-concat-and-webpack-stream