refactor: move welcome.html to src/, simplify vite build config, cleanup cli.ts formatting

This commit is contained in:
Tommy D. Rossi
2026-01-23 23:57:25 +01:00
parent 18d0cdb646
commit f9869a59f2
6 changed files with 33 additions and 32 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
"permissions": ["debugger", "tabGroups", "contextMenus", "tabs"],
"host_permissions": ["<all_urls>"],
"background": {
"service_worker": "lib/background.mjs",
"service_worker": "background.js",
"type": "module"
},
"action": {
+1 -1
View File
@@ -1163,7 +1163,7 @@ function updateContextMenuVisibility(): void {
chrome.runtime.onInstalled.addListener((details) => {
if (import.meta.env.TESTING) return
if (details.reason === 'install') {
void chrome.tabs.create({ url: 'welcome.html' })
void chrome.tabs.create({ url: 'src/welcome.html' })
}
})
+10 -10
View File
@@ -38,23 +38,23 @@ export default defineConfig({
return JSON.stringify(manifest, null, 2);
}
},
{
src: resolve(__dirname, 'welcome.html'),
dest: '.'
}
]
})
],
build: {
lib: {
entry: resolve(__dirname, 'src/background.ts'),
fileName: 'lib/background',
formats: ['es']
},
outDir: 'dist',
emptyOutDir: false,
minify: false
minify: false,
rollupOptions: {
input: {
background: resolve(__dirname, 'src/background.ts'),
welcome: resolve(__dirname, 'src/welcome.html'),
},
output: {
entryFileNames: '[name].js',
},
},
},
define: defineEnv
});