Skip to content

Commit

Permalink
Add an example of multiple invocations of the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Oct 23, 2022
1 parent c483c21 commit ffb8517
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example/multiple/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "favicons-multiple-example",
"version": "1.0.0",
"description": "Demo of favicons webpack plugin",
"scripts": {
},
"keywords": [],
"author": "",
"license": "MIT"
}
Empty file added example/multiple/src/app.js
Empty file.
Binary file added example/multiple/src/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions example/multiple/src/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions example/multiple/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home</title>
</head>

<body>
</body>

</html>
51 changes: 51 additions & 0 deletions example/multiple/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const { resolve } = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const FaviconsWebpackPlugin = require('../../src/');

const webpack = require('webpack');

module.exports = (env, args) => {
return {
context: __dirname,
entry: './src/app.js',
output: {
path: resolve(__dirname, 'public'),
filename: 'app.js',
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.html',
}),
new FaviconsWebpackPlugin({
logo: './src/favicon.png',
favicons: {
icons: {
favicons: true,
android: false,
appleIcon: false,
appleStartup: false,
windows: false,
yandex: false,
},
}
}),
new FaviconsWebpackPlugin({
logo: './src/favicon.svg',
prefix: 'assets2/',
outputPath: 'assets2/',
favicons: {
icons: {
favicons: false,
android: false,
appleIcon: true,
appleStartup: false,
windows: false,
yandex: false,
},
}
}),
],
stats: "errors-only"
};
}

0 comments on commit ffb8517

Please sign in to comment.