@@ -35,6 +35,12 @@ const ALL_VARIANTS = variantsFile.legacyVariants.concat(
3535 variantsFile . manualVariants
3636)
3737
38+ function shouldCompileVariant ( variant ) {
39+ const IS_CE = [ 'ce' , 'ce_test' , 'ce_dev' ] . includes ( process . env . MIX_ENV )
40+ const shouldCompileVariant = IS_CE && variant . ee_only ? false : true
41+ return shouldCompileVariant
42+ }
43+
3844export async function compileAll ( options = { } ) {
3945 if ( process . env . NODE_ENV === 'dev' && canSkipCompile ( ) ) {
4046 console . info (
@@ -46,16 +52,17 @@ export async function compileAll(options = {}) {
4652 const bundledCode = await bundleCode ( )
4753
4854 const startTime = Date . now ( )
49- console . log ( `Starting compilation of ${ ALL_VARIANTS . length } variants...` )
55+ const variantsToCompile = ALL_VARIANTS . filter ( shouldCompileVariant )
56+ console . log ( `Starting compilation of ${ variantsToCompile . length } variants...` )
5057
5158 const bar = new progress . SingleBar (
5259 { clearOnComplete : true } ,
5360 progress . Presets . shades_classic
5461 )
55- bar . start ( ALL_VARIANTS . length , 0 )
62+ bar . start ( variantsToCompile . length , 0 )
5663
5764 const workerPool = Pool ( ( ) => spawn ( new Worker ( './worker-thread.js' ) ) )
58- ALL_VARIANTS . forEach ( ( variant ) => {
65+ variantsToCompile . forEach ( ( variant ) => {
5966 workerPool . queue ( async ( worker ) => {
6067 await worker . compileFile ( variant , { ...options , bundledCode } )
6168 bar . increment ( )
@@ -67,7 +74,7 @@ export async function compileAll(options = {}) {
6774 bar . stop ( )
6875
6976 console . log (
70- `Completed compilation of ${ ALL_VARIANTS . length } variants in ${ ( ( Date . now ( ) - startTime ) / 1000 ) . toFixed ( 2 ) } s`
77+ `Completed compilation of ${ variantsToCompile . length } variants in ${ ( ( Date . now ( ) - startTime ) / 1000 ) . toFixed ( 2 ) } s`
7178 )
7279}
7380
0 commit comments