From a2f8ad7f6b853cf47fd0c5960587b3e25e24924d Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 10 Jan 2021 08:19:00 +0200 Subject: [PATCH] Backport #32737 package.json: move `version_short` variable under the `config` object This is so that it works on npm 7.x too. --- build/generate-sri.js | 2 +- build/zip-examples.js | 7 +++---- package.json | 4 +++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build/generate-sri.js b/build/generate-sri.js index a326f67761fa..f0aa7340b4de 100644 --- a/build/generate-sri.js +++ b/build/generate-sri.js @@ -40,7 +40,7 @@ const files = [ configPropertyName: 'js_bundle_hash' }, { - file: `site/static/docs/${pkg.version_short}/assets/js/vendor/jquery.slim.min.js`, + file: `site/static/docs/${pkg.config.version_short}/assets/js/vendor/jquery.slim.min.js`, configPropertyName: 'jquery_hash' }, { diff --git a/build/zip-examples.js b/build/zip-examples.js index 002f7fb2ff88..4039021a3125 100644 --- a/build/zip-examples.js +++ b/build/zip-examples.js @@ -12,11 +12,10 @@ const path = require('path') const sh = require('shelljs') -const { - version, version_short: versionShort -} = require('../package.json') +const pkg = require('../package.json') -const folderName = `bootstrap-${version}-examples` +const versionShort = pkg.config.version_short +const folderName = `bootstrap-${pkg.version}-examples` sh.config.fatal = true diff --git a/package.json b/package.json index 5985040bf805..8eb5c8bc9b77 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,9 @@ "name": "bootstrap", "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", "version": "4.5.3", - "version_short": "4.5", + "config": { + "version_short": "4.5" + }, "keywords": [ "css", "sass",