1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/svg-sprite-loader/lib/utils/get-webpack-version.js

18 lines
576 B
JavaScript

// eslint-disable-next-line import/no-extraneous-dependencies
const webpackVersion = require.main.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;