Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #88 from doug-wade/issue-87
Browse files Browse the repository at this point in the history
Issue 87
  • Loading branch information
doug-wade authored Dec 1, 2018
2 parents 07ffbb7 + c2fb6af commit da1f9a4
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/injector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export function generateAppleTags (options, assets) {
if (asset.ios.valid === 'startup') {
applyTag(tags, 'link', {
rel: 'apple-touch-startup-image',
sizes: asset.ios.size,
href: asset.ios.href
})
} else {
Expand Down Expand Up @@ -143,6 +144,7 @@ export function generateMaskIconLink (tags, assets) {
}

function formatAppleTag (tag, content) {
debugger;
if (tag === 'apple-touch-icon') {
if (typeof content === 'string') {
return {
Expand Down
2 changes: 1 addition & 1 deletion tests/complex/test/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-startup-image href=/icons/ios/startup/icon_1024x1024.9e29ee0667fc45a8662544c71ddd52ad.png><link rel=apple-touch-icon sizes=1024x1024 href=/icons/ios/icon_1024x1024.9e29ee0667fc45a8662544c71ddd52ad.png><link rel=apple-touch-icon sizes=180x180 href=/icons/ios/icon_180x180.a1a34e3de3416faeb2f7536e92203f34.png><link rel=apple-touch-icon sizes=167x167 href=/icons/ios/icon_167x167.7bd8c50abbf30ab652aa209f2ee600eb.png><link rel=apple-touch-icon sizes=152x152 href=/icons/ios/icon_152x152.9bfa105b157b0adcdda61ac531fbdb16.png><link rel=apple-touch-icon sizes=120x120 href=/icons/ios/icon_120x120.f97da3360939ca03d215495c6b92678d.png><link rel=manifest href=/manifest.371ff9eb714f811602a4e4caad02e6c4.json crossorigin=use-credentials></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-startup-image sizes=1024x1024 href=/icons/ios/startup/icon_1024x1024.9e29ee0667fc45a8662544c71ddd52ad.png><link rel=apple-touch-icon sizes=1024x1024 href=/icons/ios/icon_1024x1024.9e29ee0667fc45a8662544c71ddd52ad.png><link rel=apple-touch-icon sizes=180x180 href=/icons/ios/icon_180x180.a1a34e3de3416faeb2f7536e92203f34.png><link rel=apple-touch-icon sizes=167x167 href=/icons/ios/icon_167x167.7bd8c50abbf30ab652aa209f2ee600eb.png><link rel=apple-touch-icon sizes=152x152 href=/icons/ios/icon_152x152.9bfa105b157b0adcdda61ac531fbdb16.png><link rel=apple-touch-icon sizes=120x120 href=/icons/ios/icon_120x120.f97da3360939ca03d215495c6b92678d.png><link rel=manifest href=/manifest.371ff9eb714f811602a4e4caad02e6c4.json crossorigin=use-credentials></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
10 changes: 9 additions & 1 deletion tests/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
const runTest = require('./runTest')
const tests = ['basic', 'complex', 'fingerprints-false', 'issue-84', 'rgb-background', 'rgba-background']
const tests = [
'basic',
'complex',
'fingerprints-false',
'issue-84',
'issue-87',
'rgb-background',
'rgba-background'
]

console.log('Running tests...')
runTest(tests.shift(), tests)
2 changes: 2 additions & 0 deletions tests/issue-87/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
output/
Empty file added tests/issue-87/app.js
Empty file.
51 changes: 51 additions & 0 deletions tests/issue-87/build/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const WebpackPwaManifest = require('../../../dist')

module.exports = {
entry: path.join(__dirname, '../app.js'),
output: {
path: path.join(__dirname, '../output'),
publicPath: '/',
filename: '[name].[hash].bundle.js'
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
minify: {
minifyCSS: true,
minifyJS: true,
collapseWhitespace: true,
collapseInlineTagWhitespace: true,
preserveLineBreaks: false,
removeAttributeQuotes: true,
removeComments: true
}
}),
new WebpackPwaManifest({
name: 'My Progressive Web App',
short_name: 'MyPWA',
description: 'My awesome Progressive Web App!',
background_color: '#ffffff',
ios: true,
icons: [
{
ios: 'startup',
src: path.resolve('./tests/icon.png'),
destination: 'icons',
sizes: '640x1136'
}, {
ios: 'startup',
src: path.resolve('./tests/icon.png'),
destination: 'icons',
sizes: '750x1334'
}, {
ios: 'startup',
src: path.resolve('./tests/icon.png'),
destination: 'icons',
sizes: '768x1024'
}
]
})
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 tests/issue-87/test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-startup-image sizes=768x768 href=/icons/icon_768x768.7a40d75cf809e000576020c0434aa435.png><link rel=apple-touch-startup-image sizes=750x750 href=/icons/icon_750x750.d67a59be834d7d9a97cbe15a2b5ce8c7.png><link rel=apple-touch-startup-image sizes=640x640 href=/icons/icon_640x640.72851c8bedcf497ceac7ae18df212797.png><link rel=manifest href=/manifest.25d9a5c421224180a2f8f20a13f7cb0e.json></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
1 change: 1 addition & 0 deletions tests/issue-87/test/main.72d5eaca4af91e626344.bundle.js

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

26 changes: 26 additions & 0 deletions tests/issue-87/test/manifest.25d9a5c421224180a2f8f20a13f7cb0e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"icons": [
{
"src": "/icons/icon_768x768.7a40d75cf809e000576020c0434aa435.png",
"sizes": "768x768",
"type": "image/png"
},
{
"src": "/icons/icon_750x750.d67a59be834d7d9a97cbe15a2b5ce8c7.png",
"sizes": "750x750",
"type": "image/png"
},
{
"src": "/icons/icon_640x640.72851c8bedcf497ceac7ae18df212797.png",
"sizes": "640x640",
"type": "image/png"
}
],
"name": "My Progressive Web App",
"short_name": "MyPWA",
"orientation": "portrait",
"display": "standalone",
"start_url": ".",
"description": "My awesome Progressive Web App!",
"background_color": "#ffffff"
}

0 comments on commit da1f9a4

Please sign in to comment.