Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
test/gulp_test/build
6 changes: 1 addition & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = function(fileName, opts) {
function endStream(){
if (!firstFile) return this.emit('end');

var contentPath = path.join(firstFile.base, fileName),
var contentPath = path.join(process.cwd(), fileName),
mapPath = contentPath + '.map';

if(!firstFile.sourceMap) {
Expand All @@ -81,8 +81,6 @@ module.exports = function(fileName, opts) {
sourceMap.file = path.basename(sourceMap.file);

var contentFile = new File({
cwd: firstFile.cwd,
base: firstFile.base,
path: contentPath,
contents: new Buffer(codeMap.code)
});
Expand All @@ -91,8 +89,6 @@ module.exports = function(fileName, opts) {
contentFile.sourceMap = sourceMap;
} else {
var mapFile = new File({
cwd: firstFile.cwd,
base: firstFile.base,
path: mapPath,
contents: new Buffer(JSON.stringify(sourceMap, null, ' '))
});
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
"source-map": "0.1.33"
},
"devDependencies": {
"mocha": "^1.18.2",
"chai": "^1.9.0"
"chai": "^1.9.0",
"coffee-script": "^1.7.1",
"gulp": "^3.8.6",
"gulp-sourcemaps": "^1.1.0",
"mocha": "^1.18.2"
}
}
13 changes: 13 additions & 0 deletions test/gulp_test/gulpfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gulp = require('gulp')
sourcemaps = require('gulp-sourcemaps')
concat = require('../..')

gulp.task 'concat', ->
return gulp.src(['./path1/file1.js', './path2/file2.js'])
.pipe sourcemaps.init()
.pipe concat 'file.js'
.pipe sourcemaps.write('.', includeContent: true)
.pipe gulp.dest('./build')

gulp.task 'default', ['concat']

1 change: 1 addition & 0 deletions test/gulp_test/path1/file1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("hello");
1 change: 1 addition & 0 deletions test/gulp_test/path2/file2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("world");