-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow compiling multiple icon sets
- Loading branch information
Showing
6 changed files
with
78 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const test = require('ava'); | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const FaviconsWebpackPlugin = require('../'); | ||
|
||
const { logo, mkdir, generate, snapshotCompilationAssets } = require('./util'); | ||
|
||
test.beforeEach(async t => (t.context.root = await mkdir())); | ||
|
||
test('should generate multiple light icons', async t => { | ||
const dist = path.join(t.context.root, 'dist'); | ||
const compilationStats = await generate({ | ||
context: t.context.root, | ||
output: { | ||
path: dist, | ||
publicPath: '/' | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin(), | ||
new FaviconsWebpackPlugin({ logo, mode: 'light' }), | ||
new FaviconsWebpackPlugin({ logo, mode: 'light', prefix: 'second/' }) | ||
] | ||
}); | ||
|
||
snapshotCompilationAssets(t, compilationStats); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Snapshot report for `test/light.multiple.test.js` | ||
|
||
The actual snapshot is saved in `light.multiple.test.js.snap`. | ||
|
||
Generated by [AVA](https://ava.li). | ||
|
||
## should generate multiple light icons | ||
|
||
> Snapshot 1 | ||
[ | ||
'assets/favicon.png', | ||
'index.html', | ||
'main.js', | ||
'second/favicon.png', | ||
] | ||
|
||
> Snapshot 2 | ||
[ | ||
{ | ||
assetName: 'assets/favicon.png', | ||
content: 'png 874x989', | ||
}, | ||
{ | ||
assetName: 'index.html', | ||
content: `␊ | ||
<!doctype html>␊ | ||
<html>␊ | ||
<head>␊ | ||
<link rel="icon"␊ | ||
href="/assets/favicon.png"␊ | ||
>␊ | ||
<link rel="icon"␊ | ||
href="/second/favicon.png"␊ | ||
>␊ | ||
</head>␊ | ||
<body>␊ | ||
</body>␊ | ||
</html>␊ | ||
`, | ||
}, | ||
{ | ||
assetName: 'second/favicon.png', | ||
content: 'png 874x989', | ||
}, | ||
] |
Binary file not shown.