File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ import path from 'path';
1313import users from './showcase.json' ;
1414import versions from './versions.json' ;
1515
16+ // See https://docs.netlify.com/configure-builds/environment-variables/
17+ const isProductionDeployment =
18+ ! ! process . env . NETLIFY && process . env . CONTEXT === 'production' ;
19+
1620const lastVersion = versions [ 0 ] ;
1721const copyright = `Copyright © ${ new Date ( ) . getFullYear ( ) } Meta Platforms, Inc.` ;
1822
@@ -156,6 +160,21 @@ const config: Config = {
156160 ] ,
157161 plugins : [
158162 'docusaurus-plugin-sass' ,
163+ function disableExpensiveBundlerOptimizationPlugin ( ) {
164+ return {
165+ name : 'disable-expensive-bundler-optimizations' ,
166+ configureWebpack ( _config , isServer ) {
167+ // This optimization is expensive and only reduces by 3% the JS assets size
168+ // Let's skip it for local and deploy preview builds
169+ // See also https://github.com/facebook/docusaurus/pull/11176
170+ return {
171+ optimization : {
172+ concatenateModules : isProductionDeployment ? ! isServer : false ,
173+ } ,
174+ } ;
175+ } ,
176+ } ;
177+ } ,
159178 [
160179 'content-docs' ,
161180 {
You can’t perform that action at this time.
0 commit comments