diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 205a01cae..754aa4c11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: # TODO (#2114): re-enable osx build. # os: [ubuntu-latest, macos-latest] os: [ubuntu-latest] - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 8cc1e34c2..810bb425c 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -42,13 +42,6 @@ const CORE_DIR = path.join(TSC_OUTPUT_DIR, 'core'); */ const COMPILED_SUFFIX = '_compressed'; -/** - * Checked-in file to cache output of closure-calculate-chunks, to - * allow for testing on node.js v12 (or earlier) which is not - * compatible with closure-calculate-chunks. - */ -const CHUNK_CACHE_FILE = 'scripts/gulpfiles/chunks.json' - /** * Name of an object to be used as a shared "global" namespace by * chunks generated by the Closure Compiler with the @@ -509,29 +502,7 @@ function getChunkOptions() { ]; const cccCommand = `closure-calculate-chunks ${cccArgs.join(' ')}`; - // Because (as of 2021-11-25) closure-calculate-chunks v3.0.2 - // requries node.js v14 or later, we save the output of cccCommand - // in a checked-in .json file, so we can use the contents of that - // file when building on older versions of node. - // - // When this is no longer necessary the following section can be - // replaced with: - // - // const rawOptions = JSON.parse(execSync(cccCommand)); - const nodeMajorVersion = /v(\d+)\./.exec(process.version)[1]; - let rawOptions; - if (nodeMajorVersion >= 14) { - rawOptions = JSON.parse(String(execSync(cccCommand))); - // Replace absolute paths with relative ones, so they will be - // valid on other machines. Only needed because we're saving this - // output to use later on another machine. - rawOptions.js = rawOptions.js.map(p => p.replace(process.cwd(), '.')); - fs.writeFileSync(CHUNK_CACHE_FILE, - JSON.stringify(rawOptions, null, 2) + '\n'); - } else { - console.log(`Warning: using pre-computed chunks from ${CHUNK_CACHE_FILE}`); - rawOptions = JSON.parse(String(fs.readFileSync(CHUNK_CACHE_FILE))); - } + const rawOptions = JSON.parse(execSync(cccCommand)); // rawOptions should now be of the form: //