Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
options: {plugins: [require('cssnano')()]},
});
}
const lessOptions = {modifyVars: {
version: `"${version}"`,
}};
// use only necessary fonts, overridable by environment variables
let isCovered = false;
for (const font of fonts) {
const override = process.env[`USE_${font.toUpperCase()}`];
const useFont = override === "true" || override !== "false" && !isCovered;
lessOptions.modifyVars[`use-${font}`] = useFont;
const support = caniuse.feature(caniuse.features[font]).stats;
isCovered = isCovered || useFont && browserslist.every(browser => {
const [name, version] = browser.split(' ');
return !support[name] || support[name][version] === 'y';
});
}
return {
mode: dev ? 'development' : 'production',
context: __dirname,
entry: {
[target.name]: target.entry,
},
output: {
filename: minimize ? '[name].min.js' : '[name].js',
library: target.library,
libraryTarget: 'umd',
export default function getSystemUiFamily(supportedBrowsers) {
const { stats } = caniuse.feature(caniuse.features['font-family-system-ui']);
const polyfillFlags = generatePolyfillFlags(stats, supportedBrowsers);
const result = ['system-ui'];
const polyfill =
[
[APPLE_SYSTEM, [
'-apple-system', // macOS, Safari >= 9.2 < 11, Firefox >= 43
]],
[BLINK_MAC_SYSTEM_FONT, [
'BlinkMacSystemFont', // macOS, Chrome < 56
]],
[NO, [
'Segoe UI', // Windows >= Vista
'Roboto', // Android >= 4
'Noto Sans', // Plasma >= 5.5
'Ubuntu', // Ubuntu >= 10.10
function getUnsupportedBrowsersByFeature(feature) {
const caniuseFeature = caniuse.features[feature]; // if feature support can be determined
if (caniuseFeature) {
const stats = caniuse.feature(caniuseFeature).stats; // return an array of browsers and versions that do not support the feature
const results = Object.keys(stats).reduce((browsers, browser) => browsers.concat(Object.keys(stats[browser]).filter(version => stats[browser][version].indexOf('y') !== 0).map(version => `${browser} ${version}`)), []);
return results;
} else {
// otherwise, return that the feature does not work in any browser
return ['> 0%'];
}
}
Object.keys(features).forEach(function (feature) {
const featureData = caniuse.feature(caniuse.features[feature])
const lackData = filterStats(browsers, featureData.stats)
const missingData = lackData.missing
const partialData = lackData.partial
// browsers with missing or partial support for this feature
const missing = lackingBrowsers(missingData)
const partial = lackingBrowsers(partialData)
if (missing.length > 0 || partial.length > 0) {
result[feature] = {
title: featureData.title,
caniuseData: featureData
}
if (missing.length > 0) {
result[feature].missingData = missingData
result[feature].missing = missing
}
function caniuse(feature, browsers, accepted = ["y"]) {
const { stats } = caniuselite.feature(caniuselite.features[feature]);
return browserslist(browsers)
.map((browser) => browser.split(" "))
.every(([browser, version]) => stats[browser] && accepted.includes(stats[browser][version]))
}
var _lodash = require("lodash.memoize");
var _lodash2 = _interopRequireDefault(_lodash);
var _browserslist = require("browserslist");
var _browserslist2 = _interopRequireDefault(_browserslist);
var _caniuseLite = require("caniuse-lite");
var _utils = require("./utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var featuresList = Object.keys(_caniuseLite.features);
var browsers = void 0;
function setBrowserScope(browserList) {
browsers = (0, _utils.cleanBrowsersList)(browserList);
}
function getBrowserScope() {
return browsers;
}
var parse = (0, _lodash2.default)(_utils.parseCaniuseData, function (feat, browsers) {
return feat.title + browsers;
});
function getSupport(query) {
var feature = void 0;
function getSupport(query) {
var feature = void 0;
try {
feature = (0, _caniuseLite.feature)(_caniuseLite.features[query]);
} catch (e) {
var res = find(query);
if (res.length === 1) return getSupport(res[0]);
throw new ReferenceError("Please provide a proper feature name. Cannot find " + query);
}
return parse(feature, browsers);
}