From f28564569610cb0cad53b53925c3e42a137420f2 Mon Sep 17 00:00:00 2001 From: turbocrime <134443988+turbocrime@users.noreply.github.com> Date: Sat, 17 Feb 2024 15:13:56 -0800 Subject: [PATCH] deduplicate wasm (#570) * deduplicate wasm * rm public/penumbra-logo.svg --------- Co-authored-by: turbocrime --- apps/extension/public/penumbra-logo.svg | 92 ------------------------ apps/extension/webpack/webpack.common.js | 25 +++---- 2 files changed, 11 insertions(+), 106 deletions(-) delete mode 100644 apps/extension/public/penumbra-logo.svg diff --git a/apps/extension/public/penumbra-logo.svg b/apps/extension/public/penumbra-logo.svg deleted file mode 100644 index 96b7c3f48e..0000000000 --- a/apps/extension/public/penumbra-logo.svg +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/extension/webpack/webpack.common.js b/apps/extension/webpack/webpack.common.js index f31387090f..37c1b13977 100644 --- a/apps/extension/webpack/webpack.common.js +++ b/apps/extension/webpack/webpack.common.js @@ -8,12 +8,12 @@ const srcDir = path.join(__dirname, '..', 'src'); export default { entry: { - popup: path.join(srcDir, 'popup.tsx'), + offscreen: path.join(srcDir, 'offscreen.ts'), page: path.join(srcDir, 'page.tsx'), - 'service-worker': path.join(srcDir, 'service-worker.ts'), + popup: path.join(srcDir, 'popup.tsx'), 'injected-connection-manager': path.join(srcDir, 'injected-connection-manager.ts'), 'injected-penumbra-global': path.join(srcDir, 'injected-penumbra-global.ts'), - offscreen: path.join(srcDir, 'offscreen.ts'), + 'service-worker': path.join(srcDir, 'service-worker.ts'), 'wasm-build-action': path.join(srcDir, 'wasm-build-action.ts'), }, output: { @@ -22,21 +22,18 @@ export default { }, optimization: { splitChunks: { - name: 'vendor', - chunks(chunk) { - // These files cannot be chunked due to their runtime env - return ( - chunk.name !== 'service-worker' && - chunk.name !== 'injected-connection-manager' && - chunk.name !== 'injected-penumbra-global' && - chunk.name !== 'offscreen' && - chunk.name !== 'wasm-build-action' - ); - }, + chunks: chunk => + ![ + 'injected-connection-manager', + 'injected-penumbra-global', + 'service-worker', + 'wasm-build-action', + ].includes(chunk.name), }, }, module: { rules: [ + { test: /\.wasm/ }, { test: /\.tsx?$/, use: 'ts-loader',