-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relocate manifest.json to ./public/ #4890
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ function generateIcons(icons, srcIcon) { | |
return Promise.map(icons, icon => { | ||
const size = parseInt(icon.sizes.substring(0, icon.sizes.lastIndexOf(`x`))) | ||
const imgPath = `./public/` + icon.src | ||
|
||
return sharp(srcIcon) | ||
.resize(size) | ||
.toFile(imgPath) | ||
|
@@ -22,7 +22,7 @@ exports.onPostBuild = (args, pluginOptions) => | |
new Promise(resolve => { | ||
const { icon } = pluginOptions | ||
const manifest = { ...pluginOptions } | ||
|
||
// Delete options we won't pass to the manifest.json. | ||
delete manifest.plugins | ||
delete manifest.icon | ||
|
@@ -40,8 +40,8 @@ exports.onPostBuild = (args, pluginOptions) => | |
fs.mkdirSync(iconPath) | ||
} | ||
|
||
fs.writeFileSync(`${iconPath}/manifest.json`, JSON.stringify(manifest)) | ||
fs.writeFileSync(`./public/manifest.json`, JSON.stringify(manifest)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @moonmeister what was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// Only auto-generate icons if a src icon is defined. | ||
if (icon !== undefined) { | ||
generateIcons(manifest.icons, icon).then(() => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you have this use path.join as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KyleAMathews fixed it! 😇