Gulp plugin for concatenating javascript with sourcemaps
npm install gulp-concat-jsgulp-concat-js
====================
Gulp plugin for concatenating javascript with sourcemaps.
This gulp plugin will concatenate all source files together with some magic,
so that it still works to require the other files. You only have to ensure you always
use "./" when requiring local modules.
If you run your code through an uglifier after this, you have obfuscated your code!
Here is a very simple gulpfile for using this module:
``js
var gulp = require("gulp");
var sourcemaps = require("gulp-sourcemaps");
var concat = require("gulp-concat-js");
gulp.task("build", function () {
return gulp.src(["lib/.{js,json}", "lib//.{js,json}"])
.pipe(sourcemaps.init())
.pipe(concat({
"target": "concatenated.js", // Name to concatenate to
"entry": "./main.js" // Entrypoint for the application, main module
// The ./ part is important! The path is relative to./lib
// whatever gulp decides is the base-path, in this
// example that is `
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest("dist"));
});