Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-react

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-react - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

23

index.js

@@ -6,2 +6,3 @@ 'use strict';

var react = require('react-tools');
var reactDomPragma = require('react-dom-pragma');

@@ -11,4 +12,3 @@ module.exports = function (options) {

if (file.isNull()) {
this.push(file);
cb();
cb(null, file);
return;

@@ -18,4 +18,3 @@ }

if (file.isStream()) {
this.emit('error', new gutil.PluginError('gulp-react', 'Streaming not supported'));
cb();
cb(new gutil.PluginError('gulp-react', 'Streaming not supported'));
return;

@@ -26,9 +25,5 @@ }

var filePath = file.path;
// http://stackoverflow.com/a/15123777
var JS_COMMENTS_REGEX = /(?:\/\*(?:[\s\S]*?)\*\/)|(?:\/\/(?:.*)$)/gm;
var commentMatches = str.match(JS_COMMENTS_REGEX);
var hasJsxComment = commentMatches && (commentMatches[0].indexOf('/**') !== -1 && commentMatches[0].indexOf('@jsx') !== -1);
if (path.extname(filePath) === '.jsx' && !hasJsxComment) {
str = '/** @jsx React.DOM */\n' + str;
if (path.extname(filePath) === '.jsx') {
str = reactDomPragma(str);
}

@@ -39,9 +34,9 @@

file.path = gutil.replaceExtension(filePath, '.js');
this.push(file);
cb(null, file);
} catch (err) {
this.emit('error', new gutil.PluginError('gulp-react', err, {fileName: filePath}));
cb(new gutil.PluginError('gulp-react', err, {
fileName: filePath
}));
}
cb();
});
};
{
"name": "gulp-react",
"version": "1.0.0",
"version": "1.0.1",
"description": "Precompile Facebook React JSX templates into JavaScript",

@@ -36,2 +36,3 @@ "license": "MIT",

"gulp-util": "^3.0.0",
"react-dom-pragma": "^1.0.0",
"react-tools": "^0.11.1",

@@ -38,0 +39,0 @@ "through2": "^0.6.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc