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

@webdiscus/pug-loader

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webdiscus/pug-loader - npm Package Compare versions

Comparing version 1.7.2 to 1.7.3

3

CHANGELOG.md
# Change log
## 1.7.3 (2022-02-19)
- fix collision with local variables passed in template function for compile method
## 1.7.2 (2022-02-19)

@@ -4,0 +7,0 @@ - fix path error in Windows when watching dependencies

4

package.json
{
"name": "@webdiscus/pug-loader",
"version": "1.7.2",
"version": "1.7.3",
"description": "The pug loader resolves paths and webpack aliases in a pug template and compiles it to HTML or into a template function.",

@@ -82,3 +82,3 @@ "keywords": [

"prettier": "^2.5.1",
"pug-plugin": "^1.4.0",
"pug-plugin": "^1.4.1",
"rimraf": "^3.0.2",

@@ -85,0 +85,0 @@ "tsconfig-paths-webpack-plugin": "^3.5.2",

@@ -144,8 +144,7 @@ // add polyfill for node.js >= 12.0.0 && < 15.0.0

// custom options from HtmlWebpackPlugin can be used in pug
let htmlWebpackPluginOptions = getHtmlWebpackPluginOptions(loaderContext);
const htmlWebpackPluginOptions = getHtmlWebpackPluginOptions(loaderContext);
const locals = merge(loaderOptions.data || {}, htmlWebpackPluginOptions, resourceParams);
const funcBody = Object.keys(locals).length ? injectExternalVariables(pugResult.body, locals) : pugResult.body;
const result = loaderMethod.export(loaderContext.resourcePath, funcBody, locals, esModule);
const locals = merge(loaderOptions.data || {}, htmlWebpackPluginOptions, resourceParams),
funcBody = Object.keys(locals).length ? injectExternalVariables(pugResult.body, locals) : pugResult.body,
result = loaderMethod.export(loaderContext.resourcePath, funcBody, locals, esModule);
callback(null, result);

@@ -152,0 +151,0 @@ };

@@ -49,3 +49,3 @@ const path = require('path');

if (str[0] !== '?') return {};
const query = str.substr(1);
const query = str.substring(1);

@@ -80,3 +80,6 @@ return parseResourceData(query);

`;\n` +
funcBody.replace(/(?<=locals_for_with = )(?:\(locals \|\| {}\))(?=;)/, 'Object.assign(__external_locals__, locals)');
funcBody.replace(
/(?<=locals_for_with = )(?:\(locals \|\| {}\))(?=;)/,
'Object.assign({}, __external_locals__, locals || {})'
);

@@ -83,0 +86,0 @@ module.exports = {

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