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
All checks were successful
Build and Release Extension / build (push) Successful in 25s
This commit is contained in:
parent
3e7c1a34af
commit
d545434815
10
package.json
10
package.json
@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "reels-master",
|
"name": "reels-master",
|
||||||
"version": "1.1.2",
|
"version": "1.2.1",
|
||||||
"description": "Chrome extension for Instagram Reels with volume control and download functionality",
|
"description": "Chrome extension for Instagram Reels with volume control and download functionality",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "BROWSER=chrome vite build --watch",
|
"dev": "BROWSER=chrome BUILD_ENTRY=background vite build && BROWSER=chrome BUILD_ENTRY=content vite build --watch",
|
||||||
"dev:firefox": "BROWSER=firefox 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": "pnpm build:chrome && pnpm build:firefox",
|
||||||
"build:chrome": "BROWSER=chrome vite build",
|
"build:chrome": "BROWSER=chrome BUILD_ENTRY=background vite build && BROWSER=chrome BUILD_ENTRY=content vite build",
|
||||||
"build:firefox": "BROWSER=firefox 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",
|
"bundle": "vite build && node scripts/bundle.js",
|
||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"description": "Enhance your Instagram experience with Reels Master - download reels, seek through videos, and more!",
|
"description": "Enhance your Instagram experience with Reels Master - download reels, seek through videos, and more!",
|
||||||
"background": {
|
"background": {
|
||||||
"service_worker": "background/background.js"
|
"scripts": ["background/background.js"]
|
||||||
},
|
},
|
||||||
"homepage_url": "https://shiftyspace.ru",
|
"homepage_url": "https://shiftyspace.ru",
|
||||||
"author": "ShiftyX1",
|
"author": "ShiftyX1",
|
||||||
|
|||||||
@ -5,15 +5,27 @@ import AdmZip from 'adm-zip';
|
|||||||
|
|
||||||
const browser = process.env.BROWSER || 'chrome';
|
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({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
outDir: 'dist',
|
outDir: 'dist',
|
||||||
emptyOutDir: true,
|
emptyOutDir: shouldEmptyOutDir,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: inputs,
|
||||||
background: resolve(__dirname, 'src/background/service-worker.ts'),
|
|
||||||
content: resolve(__dirname, 'src/content/content.ts'),
|
|
||||||
},
|
|
||||||
output: {
|
output: {
|
||||||
entryFileNames: '[name]/[name].js',
|
entryFileNames: '[name]/[name].js',
|
||||||
chunkFileNames: '[name].js',
|
chunkFileNames: '[name].js',
|
||||||
@ -25,6 +37,7 @@ export default defineConfig({
|
|||||||
{
|
{
|
||||||
name: 'copy-manifest',
|
name: 'copy-manifest',
|
||||||
closeBundle() {
|
closeBundle() {
|
||||||
|
if (!isFinalPass) return;
|
||||||
try {
|
try {
|
||||||
copyFileSync(
|
copyFileSync(
|
||||||
resolve(__dirname, `src/manifest.${browser}.json`),
|
resolve(__dirname, `src/manifest.${browser}.json`),
|
||||||
@ -39,6 +52,7 @@ export default defineConfig({
|
|||||||
{
|
{
|
||||||
name: 'create-zip',
|
name: 'create-zip',
|
||||||
closeBundle() {
|
closeBundle() {
|
||||||
|
if (!isFinalPass) return;
|
||||||
if (process.env.NODE_ENV === 'production' || !process.argv.includes('--watch')) {
|
if (process.env.NODE_ENV === 'production' || !process.argv.includes('--watch')) {
|
||||||
try {
|
try {
|
||||||
const zip = new AdmZip();
|
const zip = new AdmZip();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user