Skip to content

Commit

Permalink
feat: Add concurrency to build and add terser minify
Browse files Browse the repository at this point in the history
  • Loading branch information
memoyil committed Jan 8, 2025
1 parent 0c91ab9 commit 9219a6f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
11 changes: 11 additions & 0 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,17 @@ const config = {
maxRetries: 5,
}),
)
if (!isServer) {
webpackConfig.optimization.minimizer = [
new webpack.optimize.MinimizePlugin(),
new TerserPlugin({
parallel: true,
terserOptions: {
compress: true,
},
}),
]
}
if (!isServer && webpackConfig.optimization.splitChunks) {
// webpack doesn't understand worker deps on quote worker, so we need to manually add them
// https://github.com/webpack/webpack/issues/16895
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"dev:gamification": "pnpm turbo run dev --filter=gamification... --concurrency=50",
"storybook": "turbo run start --filter=@pancakeswap/uikit...",
"build:storybook": "turbo run build:storybook --filter=@pancakeswap/uikit...",
"build": "turbo run build --filter=web...",
"build:blog": "turbo run build --filter=blog...",
"build:aptos": "turbo run build --filter=aptos-web...",
"build:bridge": "turbo run build --filter=bridge...",
"build:games": "turbo run build --filter=games...",
"build:packages": "turbo run build --filter=./packages/* --filter=./packages/routing-sdk/addons/*",
"build:gamification": "turbo run build --filter=gamification...",
"build": "turbo run build --filter=web... --concurrency=50",
"build:blog": "turbo run build --filter=blog... --concurrency=50",
"build:aptos": "turbo run build --filter=aptos-web... --concurrency=50",
"build:bridge": "turbo run build --filter=bridge... --concurrency=50",
"build:games": "turbo run build --filter=games... --concurrency=50",
"build:packages": "turbo run build --filter=./packages/* --filter=./packages/routing-sdk/addons/* --concurrency=50",
"build:gamification": "turbo run build --filter=gamification... --concurrency=50",
"start": "turbo run start --filter=web",
"test:config": "pnpm turbo run test:config --filter=web...[HEAD^1]",
"test:ci": "pnpm turbo run test --filter=[HEAD^1]",
Expand All @@ -39,7 +39,7 @@
"updateLPsAPR": "pnpm turbo run build --filter=@pancakeswap/farms && NODE_PATH=./apps/web/src tsx --tsconfig ./apps/web/tsconfig.json scripts/updateLPsAPR.ts",
"updateAptosLPsAPR": "pnpm turbo run build --filter=@pancakeswap/aptos-swap-sdk && NODE_PATH=./apps/aptos/src tsx --tsconfig ./apps/aptos/tsconfig.json scripts/updateAptosLpsAPR/index.ts",
"updateMerkl": "NODE_PATH=./apps/web/src tsx --tsconfig ./apps/web/tsconfig.json scripts/updateMerkl/index.ts",
"clean": "turbo run clean && rm -rf node_modules",
"clean": "turbo run clean && rm -rf node_modules --concurrency=50",
"changeset": "changeset",
"version-packages": "changeset version && pnpm i --lockfile-only",
"release-packages": "turbo run build --filter=./packages/* && changeset version && changeset publish",
Expand Down

0 comments on commit 9219a6f

Please sign in to comment.