@@ -43,7 +43,10 @@ const remarkPlugins = [
4343 UnversionedDocsLinksRemark ,
4444] ;
4545
46+ // See https://docs.netlify.com/configure-builds/environment-variables/
4647const isDeployPreview = ! ! process . env . NETLIFY && process . env . CONTEXT === 'deploy-preview' ;
48+ const isNetlifyProductionDeployment = process . env . NETLIFY && process . env . CONTEXT === 'production' ;
49+ const isProductionDeployment = isNetlifyProductionDeployment ;
4750
4851const getBaseUrl = ( ) => {
4952 if ( typeof process . env . BASEURL !== 'undefined' ) {
@@ -60,6 +63,10 @@ const config = {
6063 tagline : 'Nurturing Moodle Developers' ,
6164 future : {
6265 experimental_faster : true ,
66+ v4 : {
67+ removeLegacyPostBuildHeadAttribute : true ,
68+ useCssCascadeLayers : true ,
69+ } ,
6370 } ,
6471
6572 // url: 'https://develop.moodle.org',
@@ -139,6 +146,19 @@ const config = {
139146 } ) ,
140147 /** @type {import('@docusaurus/preset-classic').ThemeConfig } */
141148 plugins : [
149+ function disableExpensiveBundlerOptimizationPlugin ( ) {
150+ // As documented in https://github.com/facebook/docusaurus/discussions/11199.
151+ return {
152+ name : 'disable-expensive-bundler-optimizations' ,
153+ configureWebpack ( _config , isServer ) {
154+ return {
155+ optimization : {
156+ concatenateModules : isProductionDeployment ? ! isServer : false ,
157+ } ,
158+ } ;
159+ } ,
160+ } ;
161+ } ,
142162 [
143163 '@docusaurus/plugin-content-docs' ,
144164 {
0 commit comments