Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 126 additions & 79 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build:md:readmes": "node scripts/markdown/readmes.mjs",
"build:md:governance": "node scripts/markdown/governance.mjs",
"build:html": "node scripts/html/index.mjs",
"build:rss-feed": "node scripts/rss-feed/index.mjs",
"build": "npm-run-all build:*",
"lint": "npm-run-all \"lint:!(fix)\"",
"lint:fix": "npm-run-all lint:*:fix",
Expand All @@ -34,6 +35,7 @@
"devDependencies": {
"@eslint/js": "^10.0.1",
"eslint": "^10.4.0",
"feed": "^6.0.0",
"globals": "^17.6.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.5",
Expand Down
1 change: 1 addition & 0 deletions pages/blog/posts/2020-10-10-webpack-5-release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: post
title: Webpack 5 release
date: 2020-10-10T00:00:00Z
authors: sokra, chenxsan
category: Release
Expand Down
1 change: 1 addition & 0 deletions pages/blog/posts/2020-12-08-roadmap-2021.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: post
title: Roadmap 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we infer the title from the ATX heading?

date: 2020-12-08T00:00:00Z
authors: sokra
category: Roadmap
Expand Down
1 change: 1 addition & 0 deletions pages/blog/posts/2026-02-03-webpack-5-105.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: post
title: Webpack 5.105
date: 2026-02-03T00:00:00Z
authors: bjohansebas
category: Release
Expand Down
1 change: 1 addition & 0 deletions pages/blog/posts/2026-02-04-roadmap-2026.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: post
title: Roadmap 2026
date: 2026-02-04T00:00:00Z
authors: evenstensberg, bjohansebas, UlisesGascon
category: Roadmap
Expand Down
1 change: 1 addition & 0 deletions pages/blog/posts/2026-04-08-webpack-5-106.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: post
title: Webpack 5.106
date: 2026-04-08T00:00:00Z
authors: bjohansebas
category: Release
Expand Down
1 change: 1 addition & 0 deletions pages/blog/posts/2026-05-19-webpack-5-107.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: post
title: Webpack 5.107
date: 2026-05-19T00:00:00Z
authors: bjohansebas
category: Release
Expand Down
6 changes: 6 additions & 0 deletions scripts/html/doc-kit.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ export default {
rel: 'icon',
href: '/assets/favicon.ico',
},
{
rel: 'alternate',
type: 'application/rss+xml',
title: 'Webpack Blog',
href: 'https://webpack.js.org/feed.xml',
},
],
},
imports: {
Expand Down
62 changes: 62 additions & 0 deletions scripts/rss-feed/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { writeFileSync, readFileSync, readdirSync } from 'node:fs';
import { join } from 'node:path';
import { Feed } from 'feed';
import matter from 'gray-matter';

const BASE_URL = 'https://webpack.js.org';
const POSTS_DIR = './pages/blog/posts';
const OUTPUT_PATH = './out/feed.xml';

function generateRSS() {
const feed = new Feed({
title: 'Webpack Blog',
description: 'Announcements and updates from the Webpack team',
id: `${BASE_URL}/blog/`,
link: `${BASE_URL}/blog/`,
language: 'en',
updated: new Date(),
feedLinks: {
rss: `${BASE_URL}/feed.xml`,
},
});

try {
const files = readdirSync(POSTS_DIR);

const posts = files
.map(file => {
const fileContent = readFileSync(join(POSTS_DIR, file), 'utf8');
const { data } = matter(fileContent);

// post URL
const postSlug = file.replace(/\.mdx?$/, '');
const postUrl = `${BASE_URL}/blog/posts/${postSlug}`;

return {
title: data.title,
link: postUrl,
date: data.date ? new Date(data.date) : null,
description: data.description || data.title,
};
})
// sort to keep newest blog at the top
.sort((a, b) => b.date.getTime() - a.date.getTime());

for (const post of posts) {
feed.addItem({
title: post.title,
id: post.link,
link: post.link,
description: post.description,
date: post.date,
});
}

writeFileSync(OUTPUT_PATH, feed.rss2(), 'utf8');
console.log(`Successfully generated RSS feed at ${OUTPUT_PATH}`);
} catch (error) {
console.error('Failed to generate RSS feed:', error.message);
}
}

generateRSS();
Comment on lines +10 to +62

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function generateRSS() {
const feed = new Feed({
title: 'Webpack Blog',
description: 'Announcements and updates from the Webpack team',
id: `${BASE_URL}/blog/`,
link: `${BASE_URL}/blog/`,
language: 'en',
updated: new Date(),
feedLinks: {
rss: `${BASE_URL}/feed.xml`,
},
});
try {
const files = readdirSync(POSTS_DIR);
const posts = files
.map(file => {
const fileContent = readFileSync(join(POSTS_DIR, file), 'utf8');
const { data } = matter(fileContent);
// post URL
const postSlug = file.replace(/\.mdx?$/, '');
const postUrl = `${BASE_URL}/blog/posts/${postSlug}`;
return {
title: data.title,
link: postUrl,
date: data.date ? new Date(data.date) : null,
description: data.description || data.title,
};
})
// sort to keep newest blog at the top
.sort((a, b) => b.date.getTime() - a.date.getTime());
for (const post of posts) {
feed.addItem({
title: post.title,
id: post.link,
link: post.link,
description: post.description,
date: post.date,
});
}
writeFileSync(OUTPUT_PATH, feed.rss2(), 'utf8');
console.log(`Successfully generated RSS feed at ${OUTPUT_PATH}`);
} catch (error) {
console.error('Failed to generate RSS feed:', error.message);
}
}
generateRSS();
const feed = new Feed({
title: 'Webpack Blog',
description: 'Announcements and updates from the Webpack team',
id: `${BASE_URL}/blog/`,
link: `${BASE_URL}/blog/`,
language: 'en',
updated: new Date(),
feedLinks: {
rss: `${BASE_URL}/feed.xml`,
},
});
try {
const files = readdirSync(POSTS_DIR);
const posts = files
.map(file => {
const fileContent = readFileSync(join(POSTS_DIR, file), 'utf8');
const { data } = matter(fileContent);
// post URL
const postSlug = file.replace(/\.mdx?$/, '');
const postUrl = `${BASE_URL}/blog/posts/${postSlug}`;
return {
title: data.title,
link: postUrl,
date: data.date ? new Date(data.date) : null,
description: data.description || data.title,
};
})
// sort to keep newest blog at the top
.sort((a, b) => b.date.getTime() - a.date.getTime());
for (const post of posts) {
feed.addItem({
title: post.title,
id: post.link,
link: post.link,
description: post.description,
date: post.date,
});
}
writeFileSync(OUTPUT_PATH, feed.rss2(), 'utf8');
console.log(`Successfully generated RSS feed at ${OUTPUT_PATH}`);

nit: we want errors to bubble up and not get swallowed

Loading