size-limit
Advanced tools
Comparing version 8.1.2 to 8.2.0
{ | ||
"name": "size-limit", | ||
"version": "8.1.2", | ||
"version": "8.2.0", | ||
"description": "CLI tool for Size Limit", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -38,9 +38,16 @@ let SizeLimitError = require('./size-limit-error') | ||
} else if (arg === '--why') { | ||
if (!plugins.has('webpack') || !plugins.has('webpack-why')) { | ||
throw new SizeLimitError('argWithoutWebpack', 'why') | ||
if (plugins.has('esbuild')) { | ||
if (!plugins.has('esbuild-why')) { | ||
throw new SizeLimitError('argWithoutAnalyzer', 'why', 'esbuild') | ||
} | ||
} | ||
// current code assume either esbuild or webpack must be present. | ||
// this should be improved to work with any bundler. | ||
else if (!plugins.has('webpack') || !plugins.has('webpack-why')) { | ||
throw new SizeLimitError('argWithoutAnalyzer', 'why', 'webpack') | ||
} | ||
args.why = true | ||
} else if (arg === '--compare-with') { | ||
if (!plugins.has('webpack') || !plugins.has('webpack-why')) { | ||
throw new SizeLimitError('argWithoutWebpack', 'compare-with') | ||
throw new SizeLimitError('argWithoutAnalyzer', 'compare-with', 'webpack', 'webpack-why') | ||
} | ||
@@ -47,0 +54,0 @@ if (!args.why) { |
@@ -10,8 +10,6 @@ const MESSAGES = { | ||
`or *@size-limit/${mod2}* plugin`, | ||
argWithoutWebpack: arg => | ||
`Argument *--${arg}* works only with *@size-limit/webpack* plugin` + | ||
(arg === 'why' || arg === 'compare-with' | ||
? ' and *@size-limit/webpack-why* plugin. You can add Bundle ' + | ||
'Analyzer to you own bundler.' | ||
: ''), | ||
argWithoutAnalyzer: (arg, bundler, analyzer = `${bundler}-${arg}`) => | ||
`Argument *--${arg}* works only with *@size-limit/${bundler}* plugin` + | ||
` and *@size-limit/${analyzer}* plugin. You can add Bundle ` + | ||
`Analyzer to you own bundler.`, | ||
argWithoutAnotherArg: (arg, anotherArg) => | ||
@@ -18,0 +16,0 @@ `Argument *--${arg}* works only with *--${anotherArg}* argument`, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31927
877