gulp-browserify icon indicating copy to clipboard operation
gulp-browserify copied to clipboard

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

Open imyoka opened this issue 10 years ago • 0 comments

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())

imyoka avatar Apr 23 '15 07:04 imyoka