pug-plugin
Advanced tools
Comparing version 2.7.6 to 2.7.7
# Change log | ||
## 2.7.7 (2022-06-22) | ||
- fix: issue by resolving asset aliases on Windows | ||
## 2.7.6 (2022-06-20) | ||
@@ -4,0 +7,0 @@ - fix: warning by watching interpolated dependencies with `compile` method of pug loader |
{ | ||
"name": "pug-plugin", | ||
"version": "2.7.6", | ||
"version": "2.7.7", | ||
"description": "Pug plugin to extract HTML, CSS and JS from Pug files defined in webpack entry. Replaces asset's source filename with hashed output filename. Replaces SVG images with inline SVG in generated HTML.", | ||
@@ -62,6 +62,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@webdiscus/pug-loader": "^2.6.5", | ||
"@webdiscus/pug-loader": "^2.6.6", | ||
"ansis": "1.3.6", | ||
"json5": "^2.2.1", | ||
"js-beautify": "^1.14.3", | ||
"js-beautify": "^1.14.4", | ||
"webpack-merge": "^5.8.0" | ||
@@ -72,3 +72,3 @@ }, | ||
"@babel/preset-env": "^7.18.2", | ||
"@types/jest": "^28.1.2", | ||
"@types/jest": "^28.1.3", | ||
"autoprefixer": "^10.4.7", | ||
@@ -87,3 +87,3 @@ "css-loader": "^6.7.1", | ||
"sass-loader": "^12.6.0", | ||
"sharp": "^0.30.6", | ||
"sharp": "^0.30.7", | ||
"tsconfig-paths-webpack-plugin": "^3.5.2", | ||
@@ -90,0 +90,0 @@ "webpack": "^5.73.0" |
const path = require('path'); | ||
const { isWin } = require('./config'); | ||
@@ -87,3 +88,5 @@ /** | ||
getDataUrl(issuerFile, sourceFile) { | ||
if (isWin) sourceFile = path.win32.normalize(sourceFile); | ||
const item = this.dataUrlAssets.get(sourceFile); | ||
return item != null && item.cache != null && item.issuers.has(issuerFile) ? item.cache.dataUrl : undefined; | ||
@@ -90,0 +93,0 @@ }, |
const path = require('path'); | ||
const AssetEntry = require('./AssetEntry'); | ||
const { parseRequest } = require('./utils'); | ||
const { isWin } = require('./config'); | ||
const { parseRequest, pathToPosix } = require('./utils'); | ||
@@ -38,4 +39,4 @@ /** | ||
const { request: sourceFile } = asset; | ||
const chunkGroup = compilation.namedChunkGroups.get(asset.name); | ||
const { name, request } = asset; | ||
const chunkGroup = compilation.namedChunkGroups.get(name); | ||
if (!chunkGroup) { | ||
@@ -57,7 +58,7 @@ // prevent error when in HRM mode after removing a script in pug | ||
const assetFile = path.posix.join(outputPublicPath, chunkFiles.values().next().value); | ||
newContent = content.replace(sourceFile, assetFile); | ||
newContent = content.replace(request, assetFile); | ||
} else { | ||
// extract original script tag with all attributes for usage it as template for chunks | ||
let srcStartPos = content.indexOf(sourceFile); | ||
let srcEndPos = srcStartPos + sourceFile.length; | ||
let srcStartPos = content.indexOf(request); | ||
let srcEndPos = srcStartPos + request.length; | ||
let tagStartPos = srcStartPos; | ||
@@ -100,3 +101,2 @@ let tagEndPos = srcEndPos; | ||
let { name } = path.parse(request); | ||
const entry = AssetEntry.findByName(name); | ||
@@ -160,2 +160,3 @@ let uniqueName = name; | ||
has(request) { | ||
if (isWin) request = pathToPosix(request); | ||
return this.files.find((item) => item.request === request); | ||
@@ -162,0 +163,0 @@ }, |
@@ -579,7 +579,6 @@ const vm = require('vm'); | ||
const { managedFiles } = module.buildInfo.snapshot; | ||
if ( | ||
managedFiles && | ||
managedFiles.has(module.request) && | ||
/\/node_modules\/(.+?)\/runtime\//.test(module.request) | ||
) { | ||
const runtimeRegexp = /\/node_modules\/(.+?)\/runtime\//; | ||
// note: on Windows only rawRequest has posix slashes in path | ||
if (managedFiles && managedFiles.has(module.request) && runtimeRegexp.test(module.rawRequest)) { | ||
AssetTrash.toTrash(file); | ||
@@ -586,0 +585,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108633
2119
Updated@webdiscus/pug-loader@^2.6.6
Updatedjs-beautify@^1.14.4