Skip to content

Commit

Permalink
Got tree shaking working! (#3669)
Browse files Browse the repository at this point in the history
* Got tree shaking working!

* Fix lint

* lint fix

---------

Co-authored-by: Jon Ator <[email protected]>
  • Loading branch information
ValarDragon and jonator authored Oct 8, 2024
1 parent 01e8914 commit 34399cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
{
"targets": {
"node": "current"
}
},
"modules": false
}
]
]
}
}
2 changes: 1 addition & 1 deletion packages/web/config/feature-flag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export const RecommendedSwapDenoms = [
"BTC",
"ETH",
"ATOM",
"TIA"
"TIA",
];
8 changes: 8 additions & 0 deletions packages/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ const config = {
},
};

module.exports = {
...module.exports,
mode: "production", // Ensure the mode is 'production' for tree shaking to work
optimization: {
usedExports: true, // This setting enables tree shaking
},
};

const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
Expand Down
1 change: 1 addition & 0 deletions packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@osmosis-labs/web",
"version": "5.1.0",
"sideEffects": false,
"private": true,
"scripts": {
"knip": "knip",
Expand Down

0 comments on commit 34399cc

Please sign in to comment.