Skip to content

Commit

Permalink
build: reduce extension and electron bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz committed Jun 6, 2024
1 parent df8ec53 commit f7c9c00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineConfig(mergeConfig(baseConfig, {
// copy
const clientFile = resolve(__dirname, './dist')

;['../browser-extension/client', '../electron/client', '../vite/client'].forEach((dir) => {
;['../vite/client'].forEach((dir) => {
fse.copySync(clientFile, resolve(__dirname, dir))
})
},
Expand Down
4 changes: 3 additions & 1 deletion packages/client/vite.lib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ export default defineConfig(mergeConfig(baseConfig, {
},
build: {
emptyOutDir: false,
outDir: 'dist/devtools-client-lib',
lib: {
entry: resolve(__dirname, './src/index.ts'),
name: 'devtoolsPanel',
fileName: () => 'devtools-panel.js',
formats: ['es'],
},
cssMinify: true,
rollupOptions: {
output: {
assetFileNames: 'devtools-panel.[ext]',
Expand All @@ -41,7 +43,7 @@ export default defineConfig(mergeConfig(baseConfig, {
enforce: 'post',
closeBundle() {
// copy
const clientFile = resolve(__dirname, './dist')
const clientFile = resolve(__dirname, './dist/devtools-client-lib')
;['../browser-extension/client', '../electron/client'].forEach((dir) => {
fse.copySync(clientFile, resolve(__dirname, dir))
})
Expand Down

0 comments on commit f7c9c00

Please sign in to comment.