- Extension package: Manifest V3, background service worker, content scripts - Phishing detection engine with heuristic analysis (typosquatting, entropy, TLD, brand impersonation) - Local URL caching layer (Storage API) for <100ms cached lookups - Popup UI with protection status, stats, and phishing report button - Options page for settings management (blocked/allowed domains, feature toggles) - Server-side extension routes: URL check, phishing report, auth, stats, exposure check - Tier-aware feature gating (Basic/Plus/Premium) - 25 passing tests for phishing detection heuristics - Declarative net request rules for known phishing patterns - DarkWatch integration for credential exposure checks - Firefox compatibility layer via build modes Co-Authored-By: Paperclip <noreply@paperclip.ing>
33 lines
821 B
TypeScript
33 lines
821 B
TypeScript
import { defineConfig } from 'vite';
|
|
import { resolve } from 'path';
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const isFirefox = mode === 'firefox';
|
|
const targetDir = isFirefox ? 'dist/firefox' : 'dist/chrome';
|
|
|
|
return {
|
|
root: '.',
|
|
build: {
|
|
outDir: targetDir,
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
input: {
|
|
background: resolve(__dirname, 'src/background/index.ts'),
|
|
content: resolve(__dirname, 'src/content/index.ts'),
|
|
popup: resolve(__dirname, 'src/popup/popup.ts'),
|
|
options: resolve(__dirname, 'src/options/options.ts'),
|
|
},
|
|
output: {
|
|
entryFileNames: '[name].js',
|
|
},
|
|
},
|
|
copyPublicDir: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
};
|
|
});
|