Skip to content

Commit

Permalink
Merge pull request #26 from drolsen/dev
Browse files Browse the repository at this point in the history
Dev 1.5.4 Release
  • Loading branch information
drolsen authored Oct 24, 2024
2 parents 4bacc46 + 22f763f commit 86daa3d
Show file tree
Hide file tree
Showing 14 changed files with 269 additions and 185 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
language: node_js
node_js:
- '14.17.0'
- '18.17.0'
282 changes: 136 additions & 146 deletions index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"webpack html favicon",
"webpack favicons"
],
"version": "1.5.1",
"version": "1.5.4",
"description": "Webpack plugin to generate favicons for devices and browsers",
"repository": "drolsen/webpack-favicons",
"bugs": {
Expand Down
30 changes: 29 additions & 1 deletion test/ava.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ test('minimal-test (no WebpackFavicons "icon": {} configuration)', t => {
test('full-test (builds lots of favicon types)', t => {
let fullTest = true;

const webmanifestTestData = fs.readFileSync(path.resolve(__dirname, '../dist/full/assets/manifest.webmanifest'), 'utf8');
const yandexBrowserManifestTestData = fs.readFileSync(path.resolve(__dirname, '../dist/full/assets/yandex-browser-manifest.json'), 'utf8');

if (!fs.existsSync(path.resolve(__dirname, '../dist/full/assets/android-chrome-144x144.png'))){
fullTest = false;
}
Expand Down Expand Up @@ -118,7 +121,32 @@ test('full-test (builds lots of favicon types)', t => {

if (!fs.existsSync(path.resolve(__dirname, '../dist/full/assets/yandex-browser-50x50.png'))){
fullTest = false;
}
}

if (!fs.existsSync(path.resolve(__dirname, '../dist/full/assets/browserconfig.xml'))){
fullTest = false;
}

if (!fs.existsSync(path.resolve(__dirname, '../dist/full/assets/manifest.webmanifest'))){
fullTest = false;
}

if (!fs.existsSync(path.resolve(__dirname, '../dist/full/assets/yandex-browser-manifest.json'))){
fullTest = false;
}

if (
webmanifestTestData.toString().indexOf('"background_color": "#fff"') === -1
|| webmanifestTestData.toString().indexOf('"theme_color": "#fff"') === -1
|| webmanifestTestData.toString().indexOf('"name": "Webpack Favicons"') === -1
|| webmanifestTestData.toString().indexOf('"description": "Favicon Generator for Webpack 5",') === -1
) {
fullTest = false;
}

if (yandexBrowserManifestTestData.toString().indexOf('"color": "#fff"') === -1) {
fullTest = false;
}

if (fullTest) {
t.pass();
Expand Down
16 changes: 14 additions & 2 deletions test/basic.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const path = require('path');
module.exports = {
entry: path.resolve(__dirname, 'test.js'),
output: {
path: path.resolve(__dirname, '../dist/basic'),
path: path.resolve(__dirname, '../dist/basic'),
publicPath: '/~media/',
filename: 'test.js',
pathinfo: false
},
Expand All @@ -23,9 +24,18 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/basic'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve('./dist')]
Expand All @@ -34,7 +44,9 @@ module.exports = {
'title': 'Basic Test',
'template': './test/test.html',
'filename': './test.html',
'minify': false
'minify': false,
'cache': true, // Enable cache
'parallel': true, // Enable parallel processing if available
}),
new WebpackFavicons({
'src': 'assets/favicon.svg',
Expand Down
14 changes: 10 additions & 4 deletions test/callback.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/callback'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve(__dirname, '../dist/callback')]
}),
new HtmlWebpackPlugin({
'title': 'Basic Test',
'title': 'Callback Test',
'template': './test/test.html',
'filename': './test.html',
'minify': false
Expand Down
13 changes: 10 additions & 3 deletions test/copy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
entry: path.resolve(__dirname, 'test.js'),
output: {
path: path.resolve(__dirname, '../dist/copy'),
publicPath: '/~media/',
filename: 'test.js',
pathinfo: false
},
Expand All @@ -23,13 +24,19 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/copy'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve('./dist/copy/')]
}),
new CopyPlugin({
patterns: [
{ from: 'test/test.html', to: './' }
Expand Down
20 changes: 14 additions & 6 deletions test/full.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,32 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/full'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve(__dirname, '../dist/full')]
}),
new HtmlWebpackPlugin({
'title': 'Basic Test',
'title': 'Full Test',
'template': './test/test.html',
'filename': './test.html',
'minify': false
}),
new WebpackFavicons({
'appName': 'Webpack Favicons',
'appDescription': 'Favicon Generator for Webpack 5',
'src': 'assets/favicon.svg',
'path': 'assets',
'background': '#000',
'theme_color': '#000',
'background': '#fff',
'theme_color': '#fff',
'icons': {
'android': true,
'appleIcon': true,
Expand Down
13 changes: 10 additions & 3 deletions test/hybridcopy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
entry: path.resolve(__dirname, 'test.js'),
output: {
path: path.resolve(__dirname, '../dist/hybrid'),
publicPath: '/~media/',
filename: 'test.js',
pathinfo: false
},
Expand All @@ -24,13 +25,19 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/hybridcopy'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve('./dist/hybrid/')]
}),
new CopyPlugin({
patterns: [
{ from: 'test/test.html', to: './' }
Expand Down
15 changes: 11 additions & 4 deletions test/minimal.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
entry: path.resolve(__dirname, 'test.js'),
output: {
path: path.resolve(__dirname, '../dist/minimal'),
publicPath: '/~media/',
filename: 'test.js',
pathinfo: false
},
Expand All @@ -23,15 +24,21 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/minimal'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve('./dist/minimal')]
}),
new HtmlWebpackPlugin({
'title': 'Basic Test',
'title': 'Minimal Test',
'template': './test/test.html',
'filename': './test.html',
'minify': false
Expand Down
14 changes: 10 additions & 4 deletions test/mixed-path.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/mixedPath'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve(__dirname, '../dist/mixed')]
}),
new HtmlWebpackPlugin({
'title': 'Basic Test',
'title': 'Mixed Path Test',
'template': './test/test.html',
'filename': './test.html',
'minify': false
Expand Down
15 changes: 11 additions & 4 deletions test/nested.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
entry: path.resolve(__dirname, 'test.js'),
output: {
path: path.resolve(__dirname, '../dist/nested'),
publicPath: '/~media/',
filename: 'test.js',
pathinfo: false
},
Expand All @@ -23,15 +24,21 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/nested'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve('./dist/nested')]
}),
new HtmlWebpackPlugin({
'title': 'Basic Test',
'title': 'Nested Test',
'template': './test/test.html',
'filename': './test.html',
'minify': false
Expand Down
14 changes: 10 additions & 4 deletions test/public-path.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ module.exports = {
}
}]
},
devtool: false,
optimization: {
minimize: false
},
stats: 'none',
cache: {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/WebpackFavicons/publicPath'),
buildDependencies: {
config: [__filename] // Invalidate cache if config changes
},
},
plugins: [
new CleanWebpackPlugin({
'cleanOnceBeforeBuildPatterns': [path.resolve('./dist/public')]
}),
new HtmlWebpackPlugin({
'title': 'Basic Test',
'title': 'Public Path Test',
'template': './test/test.html',
'filename': './test.html',
'minify': false
Expand Down

0 comments on commit 86daa3d

Please sign in to comment.