Commit 04528dd 1 parent 93c8d2d commit 04528dd Copy full SHA for 04528dd
File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import {eleventyImageTransformPlugin} from '@11ty/eleventy-img';
28
28
*/
29
29
export default function ( eleventyConfig ) {
30
30
const isProduction = process . env . PRODUCTION === 'true' ;
31
+ const shouldOptimize = process . env . OPTIMIZE === 'true' ;
31
32
32
33
eleventyConfig . on ( 'eleventy.before' , async ( ) => {
33
34
await configureHighlighting ( markdown ) ;
@@ -72,7 +73,7 @@ export default function (eleventyConfig) {
72
73
}
73
74
74
75
const result = sass . compileString ( inputContent , {
75
- style : isProduction ? 'compressed' : 'expanded' ,
76
+ style : shouldOptimize ? 'compressed' : 'expanded' ,
76
77
quietDeps : true ,
77
78
loadPaths : [ parsedPath . dir , 'src/_sass' ] ,
78
79
} ) ;
@@ -104,7 +105,7 @@ export default function (eleventyConfig) {
104
105
'src/content/guides/language/specifications' ,
105
106
) ;
106
107
107
- if ( isProduction ) {
108
+ if ( shouldOptimize ) {
108
109
// If building for production, minify/optimize the HTML output.
109
110
// Doing so during serving isn't worth the extra build time.
110
111
eleventyConfig . addTransform ( 'minify-html' , async function ( content ) {
Original file line number Diff line number Diff line change 10
10
},
11
11
"scripts" : {
12
12
"serve" : " PRODUCTION=false eleventy --serve" ,
13
- "build-site-for-staging" : " PRODUCTION=false eleventy" ,
14
- "build-site-for-production" : " PRODUCTION=true eleventy"
13
+ "build-site-for-staging" : " PRODUCTION=false OPTIMIZE=true eleventy" ,
14
+ "build-site-for-production" : " PRODUCTION=true OPTIMIZE=true eleventy"
15
15
},
16
16
"engines" : {
17
17
"node" : " >=20.10.0" ,
You can’t perform that action at this time.
0 commit comments