Socket
Socket
Sign inDemoInstall

imports-loader

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imports-loader - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

32

dist/index.js

@@ -80,11 +80,29 @@ "use strict";

if (this.sourceMap && sourceMap) {
const node = _sourceMap.SourceNode.fromStringWithSourceMap(content, new _sourceMap.SourceMapConsumer(sourceMap));
if (this.sourceMap) {
if (sourceMap) {
const node = _sourceMap.SourceNode.fromStringWithSourceMap(content, new _sourceMap.SourceMapConsumer(sourceMap));
node.prepend(`${importsCode}\n`);
node.add(codeAfterModule);
const result = node.toStringWithSourceMap({
file: this.resourcePath
node.prepend(`${importsCode}\n`);
node.add(codeAfterModule);
const result = node.toStringWithSourceMap({
file: this.resourcePath
});
callback(null, result.code, result.map.toJSON());
return;
}
const generator = new _sourceMap.SourceMapGenerator();
generator.setSourceContent(this.resourcePath, content);
generator.addMapping({
generated: {
line: importsCode.split("\n").length + 1,
column: 0
},
original: {
line: 1,
column: 0
},
source: this.resourcePath
});
callback(null, result.code, result.map.toJSON());
callback(null, `${importsCode}\n${content}\n${codeAfterModule}`, generator.toString());
return;

@@ -91,0 +109,0 @@ }

{
"name": "imports-loader",
"version": "3.1.0",
"version": "3.1.1",
"description": "imports loader module for webpack",

@@ -50,4 +50,4 @@ "license": "MIT",

"@babel/preset-env": "^7.14.2",
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",

@@ -54,0 +54,0 @@ "babel-jest": "^27.3.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