Skip to content

Commit

Permalink
fix: save the webmanifest files in directory defined in `faviconOptio…
Browse files Browse the repository at this point in the history
…ns.path`
  • Loading branch information
webdiscus committed Jan 16, 2024
1 parent 4e62003 commit 40983d1
Show file tree
Hide file tree
Showing 62 changed files with 45 additions and 40 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## 3.4.10 (2024-01-16)

- fix: save the webmanifest files in the directory defined in the `faviconOptions.path` option

## 3.4.9 (2024-01-15)

- fix: use the favicons default options for the build-in FaviconsBundlerPlugin when no plugin options
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2023, webdiscus
Copyright (c) 2024, webdiscus

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "html-bundler-webpack-plugin",
"version": "3.4.9",
"version": "3.4.10",
"description": "HTML bundler plugin for webpack handles a template as an entry point, extracts CSS and JS from their sources referenced in HTML, supports template engines like Eta, EJS, Handlebars, Nunjucks.",
"keywords": [
"html",
Expand Down
3 changes: 2 additions & 1 deletion plugins/favicons-bundler-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ class FaviconsBundlerPlugin {

// save favicon manifest files on disk
response.files.forEach(({ name, contents }) => {
compilation.emitAsset(name, new RawSource(contents));
let outputFile = path.posix.join(this.options.faviconsConfig.path, name);
compilation.emitAsset(outputFile, new RawSource(contents));
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,55 @@
"theme_color": "#fff",
"icons": [
{
"src": "/img/favicons/android-chrome-36x36.png",
"src": "/favicons/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-48x48.png",
"src": "/favicons/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-72x72.png",
"src": "/favicons/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-96x96.png",
"src": "/favicons/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-144x144.png",
"src": "/favicons/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-192x192.png",
"src": "/favicons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-256x256.png",
"src": "/favicons/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-384x384.png",
"src": "/favicons/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-512x512.png",
"src": "/favicons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
Expand Down
2 changes: 1 addition & 1 deletion test/cases/plugin-favicons-minify-true/expected/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head><title>Test</title><link rel="apple-touch-icon" sizes="1024x1024" href="/img/favicons/apple-touch-icon-1024x1024.png"><link rel="apple-touch-icon" sizes="114x114" href="/img/favicons/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/img/favicons/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/img/favicons/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/img/favicons/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="167x167" href="/img/favicons/apple-touch-icon-167x167.png"><link rel="apple-touch-icon" sizes="180x180" href="/img/favicons/apple-touch-icon-180x180.png"><link rel="apple-touch-icon" sizes="57x57" href="/img/favicons/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/img/favicons/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/img/favicons/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/img/favicons/apple-touch-icon-76x76.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/favicons/favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="/img/favicons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="48x48" href="/img/favicons/favicon-48x48.png"><link rel="icon" type="image/x-icon" href="/img/favicons/favicon.ico"><link rel="manifest" href="/img/favicons/manifest.webmanifest"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="My App"><meta name="application-name" content="My App"><meta name="mobile-web-app-capable" content="yes"><meta name="theme-color" content="#fff"><link href="style.bundle.css" rel="stylesheet"/><script src="main.bundle.js" defer="defer"></script></head><body><h1>Hello World!</h1></body></html>
<!doctype html><html><head><title>Test</title><link rel="apple-touch-icon" sizes="1024x1024" href="/favicons/apple-touch-icon-1024x1024.png"><link rel="apple-touch-icon" sizes="114x114" href="/favicons/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/favicons/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/favicons/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/favicons/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="167x167" href="/favicons/apple-touch-icon-167x167.png"><link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon-180x180.png"><link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/favicons/apple-touch-icon-76x76.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="48x48" href="/favicons/favicon-48x48.png"><link rel="icon" type="image/x-icon" href="/favicons/favicon.ico"><link rel="manifest" href="/favicons/manifest.webmanifest"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="My App"><meta name="application-name" content="My App"><meta name="mobile-web-app-capable" content="yes"><meta name="theme-color" content="#fff"><link href="style.bundle.css" rel="stylesheet"/><script src="main.bundle.js" defer="defer"></script></head><body><h1>Hello World!</h1></body></html>
2 changes: 1 addition & 1 deletion test/cases/plugin-favicons-minify-true/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
enabled: 'auto', // true, false, auto - generate favicons in production mode only
// favicons configuration options, see https://github.com/itgalaxy/favicons#usage
faviconOptions: {
path: '/img/favicons',
path: '/favicons',
appName: 'My App',
icons: {
android: true, // Create Android homescreen icon.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,55 @@
"theme_color": "#fff",
"icons": [
{
"src": "/img/favicons/android-chrome-36x36.png",
"src": "/favicons/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-48x48.png",
"src": "/favicons/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-72x72.png",
"src": "/favicons/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-96x96.png",
"src": "/favicons/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-144x144.png",
"src": "/favicons/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-192x192.png",
"src": "/favicons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-256x256.png",
"src": "/favicons/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-384x384.png",
"src": "/favicons/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "any"
},
{
"src": "/img/favicons/android-chrome-512x512.png",
"src": "/favicons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
Expand Down
32 changes: 16 additions & 16 deletions test/cases/plugin-favicons/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
<html>
<head>
<title>Test</title>
<link rel="apple-touch-icon" sizes="1024x1024" href="/img/favicons/apple-touch-icon-1024x1024.png">
<link rel="apple-touch-icon" sizes="114x114" href="/img/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/img/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/img/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/img/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="167x167" href="/img/favicons/apple-touch-icon-167x167.png">
<link rel="apple-touch-icon" sizes="180x180" href="/img/favicons/apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="57x57" href="/img/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/img/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/img/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/img/favicons/apple-touch-icon-76x76.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="48x48" href="/img/favicons/favicon-48x48.png">
<link rel="icon" type="image/x-icon" href="/img/favicons/favicon.ico">
<link rel="manifest" href="/img/favicons/manifest.webmanifest">
<link rel="apple-touch-icon" sizes="1024x1024" href="/favicons/apple-touch-icon-1024x1024.png">
<link rel="apple-touch-icon" sizes="114x114" href="/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="167x167" href="/favicons/apple-touch-icon-167x167.png">
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/favicons/apple-touch-icon-76x76.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="48x48" href="/favicons/favicon-48x48.png">
<link rel="icon" type="image/x-icon" href="/favicons/favicon.ico">
<link rel="manifest" href="/favicons/manifest.webmanifest">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="My App">
Expand Down
2 changes: 1 addition & 1 deletion test/cases/plugin-favicons/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
enabled: 'auto', // true, false, auto - generate favicons in production mode only
// favicons configuration options, see https://github.com/itgalaxy/favicons#usage
faviconOptions: {
path: '/img/favicons',
path: '/favicons',
appName: 'My App',
icons: {
android: true, // Create Android homescreen icon.
Expand Down

0 comments on commit 40983d1

Please sign in to comment.