Skip to content

Commit

Permalink
fix: disable minify for frieofx dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mubaidr committed Jan 9, 2025
1 parent b1166cd commit f47629c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions vite.firefox.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { crx } from "@crxjs/vite-plugin"
import { defineConfig } from "vite"
import zipPack from "vite-plugin-zip-pack"
Expand All @@ -17,12 +16,12 @@ function printDevMessage() {
setTimeout(() => {
console.info("\n")
console.info(
`${chalk.greenBright(`✅ Successfully built for ${browser}.`)}`
`${chalk.greenBright(`✅ Successfully built for ${browser}.`)}`,
)
console.info(
chalk.greenBright(
`🚀 To load this extension in Firefox, go to about:debugging, click "This Firefox", then click "Load Temporary Add-on" and select the extension's manifest file in ${browserOutDir}.`
)
`🚀 To load this extension in Firefox, go to about:debugging, click "This Firefox", then click "Load Temporary Add-on" and select the extension's manifest file in ${browserOutDir}.`,
),
)
console.info("\n")
}, 50)
Expand All @@ -32,15 +31,15 @@ function printProdMessage() {
setTimeout(() => {
console.info("\n")
console.info(
`${chalk.greenBright(`✅ Successfully built for ${browser}.`)}`
`${chalk.greenBright(`✅ Successfully built for ${browser}.`)}`,
)
console.info(
`${chalk.greenBright(`📦 Zip File for ${browser} is located at ${outDir}/${outFileName}. You can upload this to respective store. `)}`
`${chalk.greenBright(`📦 Zip File for ${browser} is located at ${outDir}/${outFileName}. You can upload this to respective store. `)}`,
)
console.info(
chalk.greenBright(
`🚀 To load this extension in Firefox, go to about:debugging, click "This Firefox", then click "Load Temporary Add-on" and select the extension's manifest file in ${browserOutDir}.`
)
`🚀 To load this extension in Firefox, go to about:debugging, click "This Firefox", then click "Load Temporary Add-on" and select the extension's manifest file in ${browserOutDir}.`,
),
)
console.info("\n")
}, 50)
Expand All @@ -56,14 +55,19 @@ if (!ViteConfig.plugins) {

ViteConfig.build.outDir = browserOutDir

if (IS_DEV) {
ViteConfig.build.minify = false
ViteConfig.build.sourcemap = true
}

ViteConfig.plugins.unshift(
crx({
manifest,
browser,
contentScripts: {
injectCss: true,
},
})
}),
)

if (IS_DEV) {
Expand All @@ -90,7 +94,7 @@ if (IS_DEV) {
outFileName,
filter: (fileName, filePath, isDirectory) =>
!(isDirectory && filePath.includes(".vite")),
})
}),
)

ViteConfig.plugins.push({
Expand Down

0 comments on commit f47629c

Please # to comment.