Comments (9)
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.
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.
I'm experiencing the same problem. Any progress on this?
from gulp-coffee.
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.
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.
just got the same problem, any one could help?
from gulp-coffee.
➕ 1️⃣
from gulp-coffee.
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.
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)
- Let's bump new version! HOT 5
- Converts variables with @$ to _at_$ HOT 6
- What's the canonical way to do partial rebuilds? HOT 1
- Error handler being ignored HOT 3
- Support the --join option HOT 5
- Formatting errors with gulp-util HOT 8
- How can I include file ? HOT 1
- why does gulp-coffee uglify the compiled *.js file under 'build/' using gulp-coffee HOT 2
- Latest version of Coffeescript HOT 2
- gulp-coffee won't compile after an error occured(and handled) when used with gulp-watch HOT 4
- do sourcemaps still work? HOT 3
- Update coffee-script dependency HOT 2
- Cofeescript2 support? HOT 5
- Update Node versions tested in CI
- Remove lock files HOT 2
- Update repo location HOT 1
- How not to strip empty lines? HOT 2
- remove gulp-util using the following API replacements HOT 1
- Needs new release to remove merge vulnerability HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-coffee.