Files
actual/packages/plugins-service/vite.config.mts
lelemm be35328e42 🐛 Fix to show the notification for updating service worker (#5963)
* Fix to show the notification for updating service worker

* cleanup

* Add release notes for PR #5963

* trigger pipeline

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-10-19 22:48:05 -03:00

40 lines
866 B
TypeScript

// @ts-strict-ignore
import path from 'path';
import { defineConfig } from 'vite';
export default defineConfig(({ mode }) => {
const isDev = mode === 'development';
const outDir = path.resolve(__dirname, 'dist');
return {
mode,
build: {
target: 'es2020',
outDir,
emptyOutDir: true,
lib: {
entry: path.resolve(__dirname, 'src/plugin-service-worker.ts'),
name: 'plugin_sw',
formats: ['iife'],
fileName: () => `plugin-sw.js`,
},
sourcemap: true,
minify: isDev ? false : 'terser',
terserOptions: {
compress: {
drop_debugger: false,
},
mangle: false,
},
},
resolve: {
extensions: ['.js', '.ts', '.json'],
},
define: {
'process.env': '{}',
'process.env.IS_DEV': JSON.stringify(isDev),
},
};
});