Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialFabian Socarras
Courses Plus Student 421 PointsSource map for minified script.
If you're also using the minify task, how do you build a source map of the minified js file?
2 Answers
Iain Diamond
29,379 PointsThe same technique, using
maps = require('gulp-sourcemaps');
seems to work for Sass and JS files:
gulp.task('uglifyJS', ['concatJS'], function() {
return gulp.src("js/app.js")
.pipe(maps.init())
.pipe(uglify())
.pipe(maps.write('./'))
.pipe(rename('app.min.js'))
.pipe(gulp.dest('js'));
});
gulp.task('compileSass', function() {
return gulp.src('scss/application.scss')
.pipe(maps.init())
.pipe(sass({
outputStyle: 'compressed'
}))
.pipe(maps.write('./'))
.pipe(gulp.dest('css'));
});
Hope this helps, iain
Fabian Socarras
Courses Plus Student 421 PointsHey thanks, Lain. That worked for me.
Iain Simmons
Treehouse Moderator 32,305 PointsIain Simmons
Treehouse Moderator 32,305 PointsI see you get 'Lain' as well... it's tough having an uncommon spelling of a common name! :)