build(docs-infra): switch the generate-stackblitz/zips scripts to ESM (#42921)

Switch the JS scripts used for generating StackBlitz projects and zips
from CommonJS to ESM format. This is necessary for upgrading the
`globby` dependency to [version 12.0.0][1] in a subsequent commit.

[1]: https://github.com/sindresorhus/globby/releases/v12.0.0

PR Close #42921
This commit is contained in:
George Kalpakas
2021-07-22 14:38:18 +03:00
committed by Dylan Hunn
parent 99f833869d
commit 662addb355
8 changed files with 50 additions and 44 deletions
@@ -0,0 +1,9 @@
import {dirname, join} from 'path';
import {fileURLToPath} from 'url';
import {StackblitzBuilder} from './builder.mjs';
const __dirname = dirname(fileURLToPath(import.meta.url));
const EXAMPLES_PATH = join(__dirname, '../../content/examples');
const LIVE_EXAMPLES_PATH = join(__dirname, '../../src/generated/live-examples');
new StackblitzBuilder(EXAMPLES_PATH, LIVE_EXAMPLES_PATH).build();