New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-component-inline

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-component-inline - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

18

index.js

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

var template = require('ali-arttemplate');
var sass = require('sass');
var cssmin = require('cssmin');

@@ -13,3 +14,3 @@ var gutil = require('gulp-util');

var PLUGIN_NAME = 'gulp-component-inline';
var INLINE_REGEX = /__inline\([^\)].*\)/m;
var INLINE_REGEX = /__inline\([^\)].*\)/mg;
var FILE_REGEX = /__inline\(["']([^"^']*)/;

@@ -31,3 +32,3 @@

if (file.isBuffer()) {
var contents = fs.readFileSync(file, 'utf-8');
var contents = fs.readFileSync(file.path, 'utf-8');

@@ -45,3 +46,3 @@ contents = contents.replace(INLINE_REGEX, function(matchString, index) {

if(/\.css$/.test(compFile)) {
if (/\.s?css$/.test(compFile)) {
compileResult = compileCss(compFile);

@@ -56,5 +57,12 @@ } else {

function compileCss(compFile) {
var result = fs.readFileSync(compFile, 'utf-8');
var result;
result = cssmin(result);
if (/\.scss$/.test(compFile)) {
result = sass.renderSync({file:compFile});
result = cssmin(String(result.css));
} else {
result = fs.readFileSync(compFile, 'utf-8');
result = cssmin(result);
}
result = result.replace(/\'/g, '"');

@@ -61,0 +69,0 @@

{
"name": "gulp-component-inline",
"version": "1.0.2",
"version": "1.0.3",
"description": "Support for referencing artTemplate file (or css files) directly in JS by '__inline', then compile them into JS",

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

"gulp-util": "^3.0.8",
"sass": "^1.0.0-beta.2",
"through2": "^2.0.3"

@@ -44,5 +45,4 @@ },

"mocha": "^3.5.0",
"should": "^13.0.1",
"vinyl": "^2.1.0"
"should": "^13.0.1"
}
}
# gulp-component-inline
[![Build Status](travis-img)](travis-url)
[![Coverage Status](coveralls-img)](coveralls-url)
[![Build Status][travis-img]][travis-url]
[![Coverage Status][coveralls-img]][coveralls-url]
[![License][license-img]][license-url]

@@ -5,0 +5,0 @@

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