Stop trying to compile detector and verifier on CE (#5857)
This commit is contained in:
parent
0405055f95
commit
a204c89066
|
|
@ -35,6 +35,12 @@ const ALL_VARIANTS = variantsFile.legacyVariants.concat(
|
||||||
variantsFile.manualVariants
|
variantsFile.manualVariants
|
||||||
)
|
)
|
||||||
|
|
||||||
|
function shouldCompileVariant(variant) {
|
||||||
|
const IS_CE = ['ce', 'ce_test', 'ce_dev'].includes(process.env.MIX_ENV)
|
||||||
|
const shouldCompileVariant = IS_CE && variant.ee_only ? false : true
|
||||||
|
return shouldCompileVariant
|
||||||
|
}
|
||||||
|
|
||||||
export async function compileAll(options = {}) {
|
export async function compileAll(options = {}) {
|
||||||
if (process.env.NODE_ENV === 'dev' && canSkipCompile()) {
|
if (process.env.NODE_ENV === 'dev' && canSkipCompile()) {
|
||||||
console.info(
|
console.info(
|
||||||
|
|
@ -46,16 +52,17 @@ export async function compileAll(options = {}) {
|
||||||
const bundledCode = await bundleCode()
|
const bundledCode = await bundleCode()
|
||||||
|
|
||||||
const startTime = Date.now()
|
const startTime = Date.now()
|
||||||
console.log(`Starting compilation of ${ALL_VARIANTS.length} variants...`)
|
const variantsToCompile = ALL_VARIANTS.filter(shouldCompileVariant)
|
||||||
|
console.log(`Starting compilation of ${variantsToCompile.length} variants...`)
|
||||||
|
|
||||||
const bar = new progress.SingleBar(
|
const bar = new progress.SingleBar(
|
||||||
{ clearOnComplete: true },
|
{ clearOnComplete: true },
|
||||||
progress.Presets.shades_classic
|
progress.Presets.shades_classic
|
||||||
)
|
)
|
||||||
bar.start(ALL_VARIANTS.length, 0)
|
bar.start(variantsToCompile.length, 0)
|
||||||
|
|
||||||
const workerPool = Pool(() => spawn(new Worker('./worker-thread.js')))
|
const workerPool = Pool(() => spawn(new Worker('./worker-thread.js')))
|
||||||
ALL_VARIANTS.forEach((variant) => {
|
variantsToCompile.forEach((variant) => {
|
||||||
workerPool.queue(async (worker) => {
|
workerPool.queue(async (worker) => {
|
||||||
await worker.compileFile(variant, { ...options, bundledCode })
|
await worker.compileFile(variant, { ...options, bundledCode })
|
||||||
bar.increment()
|
bar.increment()
|
||||||
|
|
@ -67,7 +74,7 @@ export async function compileAll(options = {}) {
|
||||||
bar.stop()
|
bar.stop()
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
`Completed compilation of ${ALL_VARIANTS.length} variants in ${((Date.now() - startTime) / 1000).toFixed(2)}s`
|
`Completed compilation of ${variantsToCompile.length} variants in ${((Date.now() - startTime) / 1000).toFixed(2)}s`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,14 @@
|
||||||
"npm_package": "esm"
|
"npm_package": "esm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"ee_only": true,
|
||||||
"name": "detector.js",
|
"name": "detector.js",
|
||||||
"entry_point": "installation_support/detector.js",
|
"entry_point": "installation_support/detector.js",
|
||||||
"output_path": "priv/tracker/installation_support/detector.js",
|
"output_path": "priv/tracker/installation_support/detector.js",
|
||||||
"globals": {}
|
"globals": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"ee_only": true,
|
||||||
"name": "verifier.js",
|
"name": "verifier.js",
|
||||||
"entry_point": "installation_support/verifier.js",
|
"entry_point": "installation_support/verifier.js",
|
||||||
"output_path": "priv/tracker/installation_support/verifier.js",
|
"output_path": "priv/tracker/installation_support/verifier.js",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue