deepak1556 / gulp-browserify

Bundle modules with BrowserifyJS
MIT License
195 stars 45 forks source link

browserify+ coffeeify+ preprocess cannot work right.Here's my gulpfile. #82

Open imyoka opened 9 years ago

imyoka commented 9 years ago

I want to transfer the variable of DEMO_NAME to main.coffee.But when comes to browserify, the ouput simply print literally ''/* @echo DEMO_NAME */''. Surely the browserify issues ,right?

gulp.task 'browserify', ->
    options =
        transform: ['coffeeify']
        extensions: ['.coffee']
    gulp.src('./view/coffee/main.coffee', read: false)
        .pipe(plumber(errorHandler: notify.onError("Error: <%= error.message %>")))
        .pipe(browserify(options))
        .pipe(preprocess({context: { NODE_ENV: 'TEST', DEMO_NAME: demoName, DEBUG: true}}))
        .pipe(rename('main.js'))
        .pipe(gulp.dest('test/'))
        .pipe(notify('browserify success!'))
        .pipe(connect.reload())