You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
563 B
18 lines
563 B
5 months ago
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||
|
const webpackVersion = require('webpack/package.json').version;
|
||
|
|
||
|
/**
|
||
|
* @param {boolean} [onlyMajor=true]
|
||
|
* @return {string}
|
||
|
*/
|
||
|
function getWebpackVersion(onlyMajor = true) {
|
||
|
return onlyMajor ? webpackVersion.split('.')[0] : webpackVersion;
|
||
|
}
|
||
|
|
||
|
getWebpackVersion.IS_1 = getWebpackVersion() === '1';
|
||
|
getWebpackVersion.IS_2 = getWebpackVersion() === '2';
|
||
|
getWebpackVersion.IS_3 = getWebpackVersion() === '3';
|
||
|
getWebpackVersion.IS_4 = getWebpackVersion() === '4';
|
||
|
|
||
|
module.exports = getWebpackVersion;
|