mirror of
https://github.com/google/blockly.git
synced 2025-12-16 06:10:12 +01:00
build: Refactor gulpfiles from CJS to ESM (#9149)
* refactor(build): Rename "package" gulp task (but not npm script) to "pack" This is to avoid an issue due to "package" being a reserved word in JavaScript, and therefore not a valid export identifier. * refactor(build): Convert gulpfile.js from CJS to ESM. * refactor(build): Convert scripts/gulpfiles/*.js from CJS to ESM * fix(build): Fix eslint warning for @license tag in gulpfile.mjs * chore(build): Remove unused imports * fix(build): Fix incorrect import of gulp-gzip * fix(build): Fix incorrect sourcemaps import reference
This commit is contained in:
committed by
GitHub
parent
6a04d0eadb
commit
9424deb06a
95
gulpfile.mjs
Normal file
95
gulpfile.mjs
Normal file
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Gulp script to build Blockly for Node & NPM.
|
||||
* Run this script by calling "npm install" in this directory.
|
||||
*/
|
||||
/* eslint-env node */
|
||||
|
||||
// Needed to prevent prettier from munging exports order, due to
|
||||
// https://github.com/simonhaenisch/prettier-plugin-organize-imports/issues/146
|
||||
// - but has the unfortunate side effect of suppressing ordering of
|
||||
// imports too:
|
||||
//
|
||||
// organize-imports-ignore
|
||||
|
||||
import {parallel} from 'gulp';
|
||||
import {
|
||||
deployDemos,
|
||||
deployDemosBeta,
|
||||
prepareDemos,
|
||||
} from './scripts/gulpfiles/appengine_tasks.mjs';
|
||||
import {
|
||||
build,
|
||||
buildAdvancedCompilationTest,
|
||||
cleanBuildDir,
|
||||
langfiles,
|
||||
messages,
|
||||
minify,
|
||||
tsc,
|
||||
} from './scripts/gulpfiles/build_tasks.mjs';
|
||||
import {docs} from './scripts/gulpfiles/docs_tasks.mjs';
|
||||
import {
|
||||
createRC,
|
||||
syncDevelop,
|
||||
syncMaster,
|
||||
updateGithubPages,
|
||||
} from './scripts/gulpfiles/git_tasks.mjs';
|
||||
import {cleanReleaseDir, pack} from './scripts/gulpfiles/package_tasks.mjs';
|
||||
import {
|
||||
publish,
|
||||
publishBeta,
|
||||
recompile,
|
||||
} from './scripts/gulpfiles/release_tasks.mjs';
|
||||
import {generators, test} from './scripts/gulpfiles/test_tasks.mjs';
|
||||
|
||||
const clean = parallel(cleanBuildDir, cleanReleaseDir);
|
||||
|
||||
// Default target if gulp invoked without specifying.
|
||||
export default build;
|
||||
|
||||
// Main sequence targets. They already invoke prerequisites. Listed
|
||||
// in typical order of invocation, and strictly listing prerequisites
|
||||
// before dependants.
|
||||
//
|
||||
// prettier-ignore
|
||||
export {
|
||||
langfiles,
|
||||
tsc,
|
||||
minify,
|
||||
build,
|
||||
pack, // Formerly package.
|
||||
publishBeta,
|
||||
publish,
|
||||
prepareDemos,
|
||||
deployDemosBeta,
|
||||
deployDemos,
|
||||
updateGithubPages as gitUpdateGithubPages,
|
||||
}
|
||||
|
||||
// Manually-invokable targets that also invoke prerequisites where
|
||||
// required.
|
||||
//
|
||||
// prettier-ignore
|
||||
export {
|
||||
messages, // Generate msg/json/en.json et al.
|
||||
clean,
|
||||
test,
|
||||
generators as testGenerators,
|
||||
buildAdvancedCompilationTest,
|
||||
createRC as gitCreateRC,
|
||||
docs,
|
||||
}
|
||||
|
||||
// Legacy targets, to be deleted.
|
||||
//
|
||||
// prettier-ignore
|
||||
export {
|
||||
recompile,
|
||||
syncDevelop as gitSyncDevelop,
|
||||
syncMaster as gitSyncMaster,
|
||||
}
|
||||
Reference in New Issue
Block a user