fix --no-compress and update snapshots until terser is fixed

This commit is contained in:
Leah 2019-06-07 19:22:40 +02:00
parent 0eadcd9bce
commit 1066af7942
6 changed files with 347 additions and 74 deletions

View File

@ -166,7 +166,10 @@ export default async function microbundle(inputOptions) {
options.multipleEntries = options.entries.length > 1;
// to disable compress you can put in false or 0 but it's a string so our boolean checks won't work
options.compress = options.compress !== 'false' && options.compress !== '0';
options.compress =
typeof options.compress !== 'boolean'
? options.compress !== 'false' && options.compress !== '0'
: options.compress;
let formats = (options.format || options.formats).split(',');
// always compile cjs first if it's there:

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,6 @@
{
"name": "basic-no-compress",
"scripts": {
"build": "microbundle --compress=false"
}
}

View File

@ -0,0 +1,5 @@
import { two } from './two';
export default async function(...args) {
return [await two(...args), await two(...args)];
}

View File

@ -0,0 +1,3 @@
export async function two(...args) {
return args.reduce((total, value) => total + value, 0);
}

View File

@ -1,6 +1,6 @@
{
"name": "basic-no-compress",
"scripts": {
"build": "microbundle --compress=false"
"build": "microbundle --no-compress"
}
}