Files
blockly/scripts/gulpfiles/helper_tasks.mjs
Christopher Allen 9424deb06a 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
2025-06-30 17:32:08 +01:00

26 lines
559 B
JavaScript

/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Any gulp helper functions.
*/
import Module from "node:module";
const require = Module.createRequire(import.meta.url);
/**
* Load and return the contents of package.json.
*
* Uses require() rather than import, and clears the require cache, to
* ensure the loaded package.json data is up to date.
*/
export function getPackageJson() {
delete require.cache[require.resolve('../../package.json')];
return require('../../package.json');
}