Bump version to 1.2.1 and enhance build scripts for better Firefox compatibility
All checks were successful
Build and Release Extension / build (push) Successful in 25s

This commit is contained in:
Илья Глазунов 2026-04-19 16:45:28 +03:00
parent 3e7c1a34af
commit d545434815
3 changed files with 25 additions and 11 deletions

View File

@ -1,14 +1,14 @@
{
"name": "reels-master",
"version": "1.1.2",
"version": "1.2.1",
"description": "Chrome extension for Instagram Reels with volume control and download functionality",
"main": "index.js",
"scripts": {
"dev": "BROWSER=chrome vite build --watch",
"dev:firefox": "BROWSER=firefox vite build --watch",
"dev": "BROWSER=chrome BUILD_ENTRY=background vite build && BROWSER=chrome BUILD_ENTRY=content vite build --watch",
"dev:firefox": "BROWSER=firefox BUILD_ENTRY=background vite build && BROWSER=firefox BUILD_ENTRY=content vite build --watch",
"build": "pnpm build:chrome && pnpm build:firefox",
"build:chrome": "BROWSER=chrome vite build",
"build:firefox": "BROWSER=firefox vite build",
"build:chrome": "BROWSER=chrome BUILD_ENTRY=background vite build && BROWSER=chrome BUILD_ENTRY=content vite build",
"build:firefox": "BROWSER=firefox BUILD_ENTRY=background vite build && BROWSER=firefox BUILD_ENTRY=content vite build",
"bundle": "vite build && node scripts/bundle.js",
"type-check": "tsc --noEmit"
},

View File

@ -4,7 +4,7 @@
"version": "1.1.2",
"description": "Enhance your Instagram experience with Reels Master - download reels, seek through videos, and more!",
"background": {
"service_worker": "background/background.js"
"scripts": ["background/background.js"]
},
"homepage_url": "https://shiftyspace.ru",
"author": "ShiftyX1",

View File

@ -5,15 +5,27 @@ import AdmZip from 'adm-zip';
const browser = process.env.BROWSER || 'chrome';
const buildEntry = process.env.BUILD_ENTRY; // 'background' | 'content' | undefined (both)
const inputs =
buildEntry === 'background'
? { background: resolve(__dirname, 'src/background/service-worker.ts') }
: buildEntry === 'content'
? { content: resolve(__dirname, 'src/content/content.ts') }
: {
background: resolve(__dirname, 'src/background/service-worker.ts'),
content: resolve(__dirname, 'src/content/content.ts'),
};
const shouldEmptyOutDir = buildEntry !== 'content';
const isFinalPass = buildEntry !== 'background';
export default defineConfig({
build: {
outDir: 'dist',
emptyOutDir: true,
emptyOutDir: shouldEmptyOutDir,
rollupOptions: {
input: {
background: resolve(__dirname, 'src/background/service-worker.ts'),
content: resolve(__dirname, 'src/content/content.ts'),
},
input: inputs,
output: {
entryFileNames: '[name]/[name].js',
chunkFileNames: '[name].js',
@ -25,6 +37,7 @@ export default defineConfig({
{
name: 'copy-manifest',
closeBundle() {
if (!isFinalPass) return;
try {
copyFileSync(
resolve(__dirname, `src/manifest.${browser}.json`),
@ -39,6 +52,7 @@ export default defineConfig({
{
name: 'create-zip',
closeBundle() {
if (!isFinalPass) return;
if (process.env.NODE_ENV === 'production' || !process.argv.includes('--watch')) {
try {
const zip = new AdmZip();