Skip to content

Commit 5afe990

Browse files
chore: update outdated pug-loader (#20623)
1 parent 47d4b55 commit 5afe990

File tree

9 files changed

+34
-28
lines changed

9 files changed

+34
-28
lines changed

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
pkg:npm/abbrev,
2727
pkg:npm/@pkgjs/parseargs,
2828
pkg:npm/@apidevtools/json-schema-ref-parser,
29-
pkg:npm/cookie-signature
29+
pkg:npm/cookie-signature,
30+
pkg:npm/ansis
3031
allow-licenses: |
3132
0BSD,
3233
AFL-1.1,

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,15 @@ or are automatically applied via regex from your webpack configuration.
164164
| Name | Status | Install Size | Description |
165165
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------: | :--------------: | :-------------------------------------------------------------------------------------- |
166166
| <a href="https://github.com/webpack-contrib/html-loader"><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/html5/html5-original.svg"></a> | ![html-npm] | ![html-size] | Exports HTML as string, requires references to static resources |
167-
| <a href="https://github.com/pugjs/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug-npm] | ![pug-size] | Loads Pug templates and returns a function |
168-
| <a href="https://github.com/webdiscus/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug3-npm] | ![pug3-size] | Compiles Pug to a function or HTML string, useful for use with Vue, React, Angular |
167+
| <a href="https://github.com/webdiscus/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug-npm] | ![pug-size] | Compiles Pug to a function or HTML string, useful for use with Vue, React, Angular |
169168
| <a href="https://github.com/peerigon/markdown-loader"><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/markdown/markdown-original.svg"></a> | ![md-npm] | ![md-size] | Compiles Markdown to HTML |
170169
| <a href="https://github.com/posthtml/posthtml-loader"><img width="48" height="48" src="https://posthtml.github.io/posthtml/logo.svg"></a> | ![posthtml-npm] | ![posthtml-size] | Loads and transforms a HTML file using [PostHTML](https://github.com/posthtml/posthtml) |
171170
| <a href="https://github.com/pcardune/handlebars-loader"><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/handlebars/handlebars-original.svg"></a> | ![hbs-npm] | ![hbs-size] | Compiles Handlebars to HTML |
172171

173172
[html-npm]: https://img.shields.io/npm/v/html-loader.svg
174173
[html-size]: https://packagephobia.com/badge?p=html-loader
175-
[pug-npm]: https://img.shields.io/npm/v/pug-loader.svg
176-
[pug-size]: https://packagephobia.com/badge?p=pug-loader
177-
[pug3-npm]: https://img.shields.io/npm/v/@webdiscus/pug-loader.svg
178-
[pug3-size]: https://packagephobia.com/badge?p=@webdiscus/pug-loader
174+
[pug-npm]: https://img.shields.io/npm/v/@webdiscus/pug-loader.svg
175+
[pug-size]: https://packagephobia.com/badge?p=@webdiscus/pug-loader
179176
[jade-npm]: https://img.shields.io/npm/v/jade-loader.svg
180177
[jade-size]: https://packagephobia.com/badge?p=jade-loader
181178
[md-npm]: https://img.shields.io/npm/v/markdown-loader.svg

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@
306306
"watchpack",
307307
"webassembly",
308308
"webassemblyjs",
309+
"webdiscus",
309310
"webmake",
310311
"webpack",
311312
"webpack's",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"@types/neo-async": "^2.6.7",
126126
"@types/node": "^25.1.0",
127127
"@types/xxhashjs": "^0.2.4",
128+
"@webdiscus/pug-loader": "^2.11.1",
128129
"assemblyscript": "^0.28.9",
129130
"babel-loader": "^10.0.0",
130131
"bundle-loader": "^0.5.6",
@@ -171,7 +172,6 @@
171172
"prettier-2": "npm:prettier@^2",
172173
"pretty-format": "^30.0.5",
173174
"pug": "^3.0.3",
174-
"pug-loader": "^2.4.0",
175175
"raw-loader": "^4.0.1",
176176
"react": "^19.2.3",
177177
"react-dom": "^19.2.3",

test/TestCases.template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const describeCases = (config) => {
186186
},
187187
{
188188
test: /\.pug/,
189-
loader: "pug-loader"
189+
loader: "@webdiscus/pug-loader"
190190
},
191191
{
192192
test: /\.wat$/i,
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"use strict";
22

3+
const majorVersion = Number.parseInt(process.versions.node.split(".")[0], 10);
4+
35
const supportsRequireInModule = require("../../../helpers/supportsRequireInModule");
46

5-
module.exports = (config) => !config.module || supportsRequireInModule();
7+
module.exports = (config) =>
8+
majorVersion >= 16 && (!config.module || supportsRequireInModule());
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
it("should handle the pug loader correctly", function() {
2-
expect(require("!pug-loader?self!../_resources/template.pug")({ abc: "abc" })).toBe("<p>selfabc</p><h1>included</h1>");
2+
expect(require("!@webdiscus/pug-loader?self=true!../_resources/template.pug")({ abc: "abc" })).toBe("<p>selfabc</p><h1>included</h1>");
33
expect(require("../_resources/template.pug")({ abc: "abc" })).toBe("<p>abc</p><h1>included</h1>");
44
});
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"use strict";
22

3+
const majorVersion = Number.parseInt(process.versions.node.split(".")[0], 10);
4+
35
const supportsRequireInModule = require("../../../helpers/supportsRequireInModule");
46

5-
module.exports = (config) => !config.module || supportsRequireInModule();
7+
module.exports = (config) =>
8+
majorVersion >= 16 && (!config.module || supportsRequireInModule());

yarn.lock

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,6 +2587,16 @@
25872587
"@webassemblyjs/ast" "1.14.1"
25882588
"@xtuc/long" "4.2.2"
25892589

2590+
"@webdiscus/pug-loader@^2.11.1":
2591+
version "2.11.1"
2592+
resolved "https://registry.yarnpkg.com/@webdiscus/pug-loader/-/pug-loader-2.11.1.tgz#bab0be47583dec6642234bbf6d819d6fb5812aca"
2593+
integrity sha512-q5Uah/pThvPrUKdxEtFSKl0xELanOfgfl1ZBymgzh8tq5XqXTJXHESRuIqEIhzMotgojArVx/ZFcfpQwzbV5Ig==
2594+
dependencies:
2595+
ansis "3.10.0"
2596+
parse5 "^7.2.1"
2597+
pug "^3.0.3"
2598+
webpack-merge "^6.0.1"
2599+
25902600
"@webpack-cli/configtest@^3.0.1":
25912601
version "3.0.1"
25922602
resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-3.0.1.tgz#76ac285b9658fa642ce238c276264589aa2b6b57"
@@ -2767,6 +2777,11 @@ ansi-styles@^6.1.0, ansi-styles@^6.2.1:
27672777
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
27682778
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==
27692779

2780+
2781+
version "3.10.0"
2782+
resolved "https://registry.yarnpkg.com/ansis/-/ansis-3.10.0.tgz#6886afb0f729b1fa865df6b710b97a9915b7d0d4"
2783+
integrity sha512-hxDKLYT7hy3Y4sF3HxI926A3urzPxi73mZBB629m9bCVF+NyKNxbwCqqm+C/YrGPtxLwnl6d8/ZASCsz6SyvJA==
2784+
27702785
anymatch@^3.1.3:
27712786
version "3.1.3"
27722787
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
@@ -7845,7 +7860,7 @@ [email protected]:
78457860
resolved "https://registry.yarnpkg.com/parse-statements/-/parse-statements-1.0.11.tgz#8787c5d383ae5746568571614be72b0689584344"
78467861
integrity sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==
78477862

7848-
parse5@^7.1.2:
7863+
parse5@^7.1.2, parse5@^7.2.1:
78497864
version "7.3.0"
78507865
resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.3.0.tgz#d7e224fa72399c7a175099f45fc2ad024b05ec05"
78517866
integrity sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==
@@ -8200,15 +8215,6 @@ pug-load@^3.0.0:
82008215
object-assign "^4.1.1"
82018216
pug-walk "^2.0.0"
82028217

8203-
pug-loader@^2.4.0:
8204-
version "2.4.0"
8205-
resolved "https://registry.yarnpkg.com/pug-loader/-/pug-loader-2.4.0.tgz#18eebdda045d9c31c2856f1cc3ceb8d3df7ca49a"
8206-
integrity sha512-cD4bU2wmkZ1EEVyu0IfKOsh1F26KPva5oglO1Doc3knx8VpBIXmFHw16k9sITYIjQMCnRv1vb4vfQgy7VdR6eg==
8207-
dependencies:
8208-
loader-utils "^1.1.0"
8209-
pug-walk "^1.0.0"
8210-
resolve "^1.1.7"
8211-
82128218
pug-parser@^6.0.0:
82138219
version "6.0.0"
82148220
resolved "https://registry.yarnpkg.com/pug-parser/-/pug-parser-6.0.0.tgz#a8fdc035863a95b2c1dc5ebf4ecf80b4e76a1260"
@@ -8229,11 +8235,6 @@ pug-strip-comments@^2.0.0:
82298235
dependencies:
82308236
pug-error "^2.0.0"
82318237

8232-
pug-walk@^1.0.0:
8233-
version "1.1.8"
8234-
resolved "https://registry.yarnpkg.com/pug-walk/-/pug-walk-1.1.8.tgz#b408f67f27912f8c21da2f45b7230c4bd2a5ea7a"
8235-
integrity sha512-GMu3M5nUL3fju4/egXwZO0XLi6fW/K3T3VTgFQ14GxNi8btlxgT5qZL//JwZFm/2Fa64J/PNS8AZeys3wiMkVA==
8236-
82378238
pug-walk@^2.0.0:
82388239
version "2.0.0"
82398240
resolved "https://registry.yarnpkg.com/pug-walk/-/pug-walk-2.0.0.tgz#417aabc29232bb4499b5b5069a2b2d2a24d5f5fe"
@@ -8540,7 +8541,7 @@ [email protected]:
85408541
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
85418542
integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==
85428543

8543-
resolve@^1.1.7, resolve@^1.15.1, resolve@^1.20.0, resolve@^1.22.4:
8544+
resolve@^1.15.1, resolve@^1.20.0, resolve@^1.22.4:
85448545
version "1.22.10"
85458546
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39"
85468547
integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==

0 commit comments

Comments
 (0)