Skip to content
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

feat: improve icon generator, use icon*.NODE_ENV.png #172

Merged
merged 5 commits into from
Sep 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cli/plasmo/src/features/extension-devtools/generate-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ import type { CommonPath } from "./common-path"

export async function generateIcons(
{ assetsDirectory, genAssetsDirectory }: CommonPath,
iconName = "icon512.png"
iconName = process.env.NODE_ENV === "development"
? "icon512.development.png"
: "icon512.png"
) {
const image512Path = resolve(assetsDirectory, iconName)
let image512Path = resolve(assetsDirectory, iconName)
image512Path = existsSync(image512Path)
? image512Path
: resolve(assetsDirectory, "icon512.png")

if (existsSync(image512Path)) {
vLog("Make sure generated assets directory exists")
Expand Down