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

pug-plugin-modules

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

pug-plugin-modules - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

38

index.js

@@ -1,3 +0,3 @@

const path = require('path');
const resolve = require('resolve');
const path = require("path");
const resolve = require("resolve");

@@ -10,23 +10,35 @@ module.exports = function(options) {

// Strip out extension that is automatically added by Pug
file.ext = '';
file.ext = "";
file.base = file.name;
let resolvePath;
if (!file.dir && file.dir[0] !== path.sep && file.dir[0] !== '.') {
let basedir = path.dirname(source);
if (!file.dir && file.dir[0] !== path.sep && file.dir[0] !== ".") {
resolvePath = file.name;
} else {
if (file.dir[0] === path.sep) {
file.dir = `.${file.dir}`;
file.root = `.${file.root}`;
basedir = pugOptions.basedir;
}
resolvePath = path.format(file);
}
return resolve.sync(resolvePath, Object.assign({
basedir: path.dirname(source),
extensions: ['.pug', '.jade'],
packageFilter(pkg) {
return Object.assign({}, pkg, {
main: pkg.pug || pkg.main
});
}
}, options));
return resolve.sync(
resolvePath,
Object.assign(
{
basedir,
extensions: [".pug", ".jade"],
packageFilter(pkg) {
return Object.assign({}, pkg, {
main: pkg.pug || pkg.main
});
}
},
options
)
);
}
};
};
{
"name": "pug-plugin-modules",
"version": "0.2.3",
"version": "0.3.0",
"description": "Pug plugin for resolving templates in node_modules",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,1 +1,4 @@

[![npm](https://img.shields.io/npm/v/pug-plugin-modules.svg?style=flat-square)](https://www.npmjs.com/package/pug-plugin-modules)
![npm](https://img.shields.io/npm/l/pug-plugin-modules.svg?style=flat-square)
# pug-plugin-modules

@@ -2,0 +5,0 @@ Pug plugin for resolving templates in node_modules

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