Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
gulp-extract-sourcemap
Advanced tools
Gulp Task to strips an inline source into its own file and updates the original file to reference the new external source map
Gulp Task to strips an inline source into its own file and updates the original file to reference the new external source map
$ npm install --save-dev gulp-extract-sourcemap
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var extractor = require('gulp-extract-sourcemap');
var path = require('path');
gulp.task('bundle', function() {
return gulp.src( ['src/js/app.js'])
.pipe( browserify({
basedir: 'src/js/',
commondir: false,
insertGlobals: true,
debug: true
}) )
.pipe( extractor({
basedir: path.join(__dirname, 'dist'),
removeSourcesContent: true,
fakeFix: true
}) )
.pipe( gulp.dest( 'dist' ) );
});
Type : String
Specifies base directory for sources paths transformation from absolute paths to relative ones. Sources in browserify generated source maps contain absolute files paths. For correct mapping in browser we need transform them to relative paths.
If option don't specified, all paths will transform relative to streemed source file cwd. If it isn't defined, paths will transform relative to process.cwd().
Type : Boolean
You set a flag, removeSourcesContent, which will remove the sourcesContent field from the extracted source map.
Type : Boolean
gulp-browserify outputs bundled JavaScript code and inline source map containt refs to fake script filename like fake_1d87bebe.js. It causes some problems with correct source maps working in browsers. Also, if we use a bundled assets checksum version control, we have a problem. Same unchanged code after bundling have other checksum. The cause for this is random 8 symbols in said fake script filename.
You set a flag, fakeFix, which will fix it. The fake script filename wil changed to streemed source file name.
Type : String
As defult gulp-extract-sourcemap plugin cteate an external source map named as a streemed source file name with '.map' suffix. To specify different source map filename use this param.
FAQs
Gulp Task to strips an inline source into its own file and updates the original file to reference the new external source map
The npm package gulp-extract-sourcemap receives a total of 6 weekly downloads. As such, gulp-extract-sourcemap popularity was classified as not popular.
We found that gulp-extract-sourcemap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.