mirror of
https://github.com/google/blockly.git
synced 2026-01-04 23:50:12 +01:00
chore(build): Set "type": "commonjs" in dist/package.json (#8097)
Set "type": "commonjs" in the generated dist/package.json file, since the .js files in the package root are CJS. This should be a no-op since that's the default, but by setting it explicitly we ensure that any change to the repository top-level package.json to set "type": "module" won't break the published package accidentally.
This commit is contained in:
committed by
GitHub
parent
c0298652af
commit
59584c3a57
@@ -178,6 +178,12 @@ function packageJSON(done) {
|
||||
const json = JSON.parse(JSON.stringify(getPackageJson()));
|
||||
// Remove unwanted entries.
|
||||
delete json['scripts'];
|
||||
// Set "type": "commonjs", since that's what .js files in the
|
||||
// package root are. This should be a no-op since that's the
|
||||
// default, but by setting it explicitly we ensure that any chage to
|
||||
// the repository top-level package.json to set "type": "module"
|
||||
// won't break the published package accidentally.
|
||||
json.type = 'commonjs';
|
||||
// Write resulting package.json file to release directory.
|
||||
if (!fs.existsSync(RELEASE_DIR)) {
|
||||
fs.mkdirSync(RELEASE_DIR, {recursive: true});
|
||||
|
||||
Reference in New Issue
Block a user