GithubHelp home page GithubHelp logo

Comments (9)

nitely avatar nitely commented on July 17, 2024 1

You can use gulp-babel instead of coffeescript transpile option.

Example:

var gulp = require('gulp');
var babel = require('gulp-babel');
var coffee = require('gulp-coffee');

gulp.task('coffee', function() {
  gulp.src('./src/*.coffee', { sourcemaps: true })
    .pipe(coffee({bare: true}))
    .pipe(babel({presets: ['@babel/preset-env']}))
    .pipe(gulp.dest('./public/', { sourcemaps: true }));  // change to , { sourcemaps: '.' } to generate external sourcemaps
});

The transpile option should work, but it does not at the moment.

from gulp-coffee.

d9k avatar d9k commented on July 17, 2024

I'm getting error:

Error: Source map to be applied is missing the "file" property
    at assertProperty (/home/myuser/myproject/node_modules/vinyl-sourcemaps-apply/index.js:36:13)
    at applySourceMap (/home/myuser/myproject/node_modules/vinyl-sourcemaps-apply/index.js:15:3)
    at DestroyableTransform.transform [as _transform] (/home/myuser/myproject/node_modules/gulp-coffee/index.js:41:7)
    at DestroyableTransform.Transform._read (/home/myuser/myproject/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.
js:184:10)

My gulp task:

var gulp    = require('gulp'),
    coffee  = require('gulp-coffee'),
    sourcemaps = require('gulp-sourcemaps');

gulp.task('coffee', function(){
    gulp.src(config.coffeePath + '/**/*.coffee')
        .pipe(sourcemaps.init())
        .pipe(coffee({
          bare: true,
          transpile: {
            presets: [
              // Without any configuration options, babel-preset-env behaves exactly the same as babel-preset-latest (or babel-preset-es2015, babel-preset-es2016, and babel-preset-es2017 together).
              'env',
            ],
            plugins: [
              ["transform-react-jsx"]
            ],
          }
        }))
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('./static/js'));
});

from gulp-coffee.

shnam7 avatar shnam7 commented on July 17, 2024

I'm experiencing the same problem. Any progress on this?

from gulp-coffee.

yocontra avatar yocontra commented on July 17, 2024

Does adding sourceMap: true, inlineMap: true to the options work? I think they changed this recently - if that fixes it I will update the module.

from gulp-coffee.

shnam7 avatar shnam7 commented on July 17, 2024

Hi contra, Thanks for the reply.
I tried it with following options, but the result is the same.

{transpile: {presets: ['env']}, sourceMap: true, inlineMap: true}

from gulp-coffee.

phonowell avatar phonowell commented on July 17, 2024

just got the same problem, any one could help?

from gulp-coffee.

brewster1134 avatar brewster1134 commented on July 17, 2024

➕ 1️⃣

from gulp-coffee.

yocontra avatar yocontra commented on July 17, 2024

Couple of pointers to help you all:

  • Don't use gulp-sourcemaps directly anymore, sourcemaps are built into gulp 4 so you can just turn on sourcemaps in gulp.src
  • Make sure you read the coffee-script docs on how to enable sourcemaps, then it should play nicely with the gulp sourcemap support

from gulp-coffee.

brewster1134 avatar brewster1134 commented on July 17, 2024

i guess my issue was more with just being able to transpile at all... gulp-coffee doesn't support the coffeescript's transpile feature. also, i was unable to get sourcemaps to work with gulp 4... i had to still use the gulp-sourcemaps plugin. i currently don't have my project in a state to test it ATM, but would be good to hear someone confirm it is actually working...

from gulp-coffee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.