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

import-glob

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

import-glob - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

11

index.js

@@ -6,5 +6,6 @@ var glob = require("glob");

this.cacheable();
var regex = /import + ?((\w+) from )?([\'\"])(.*?)\3/gm;
var regex = /.?import + ?((\w+) from )?([\'\"])(.*?)\3/gm;
var importModules = /import +(\w+) +from +([\'\"])(.*?)\2/gm;
var importFiles = /import +([\'\"])(.*?)\1/gm;
var importSass = /@import +([\'\"])(.*?)\1/gm;
var resourceDir = path.dirname(this.resourcePath);

@@ -21,3 +22,5 @@ function replacer(match, fromStatement, obj, quote, filename) {

var fileName = quote + file + quote;
if (match.match(importModules)) {
if (match.match(importSass)) {
return '@import ' + fileName;
} else if (match.match(importModules)) {
var moduleName = obj + index;

@@ -31,5 +34,5 @@ modules.push(moduleName);

})
.join(';\n');
.join('; ');
if (result && withModules) {
result += '\nlet ' + obj + ' = [' + modules.join(', ') + ']';
result += '; let ' + obj + ' = [' + modules.join(', ') + ']';
}

@@ -36,0 +39,0 @@ return result;

{
"name": "import-glob",
"version": "1.4.0",
"version": "1.5.0",
"description": "ES6 import with glob patterns (preloader for Webpack)",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -32,3 +32,15 @@ [![Build Status](https://travis-ci.org/terpiljenya/import-glob.svg)](https://travis-ci.org/terpiljenya/import-glob)

---
__For sass:__
```scss
@import "./foo/**/*.scss";
```
Expands into
```scss
@import "./foo/1.scss";
@import "./foo/bar/2.scss";
```
---
## Install

@@ -48,3 +60,8 @@ ```sh

loader: 'import-glob'
}]
},
{
test: /\.scss/,
loader: 'import-glob'
}
]
}

@@ -51,0 +68,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