mirror of
https://github.com/developit/microbundle.git
synced 2026-01-18 13:56:35 +00:00
fix --no-compress and update snapshots until terser is fixed
This commit is contained in:
parent
0eadcd9bce
commit
1066af7942
@ -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
6
test/fixtures/basic-compress-false/package.json
vendored
Normal file
6
test/fixtures/basic-compress-false/package.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "basic-no-compress",
|
||||
"scripts": {
|
||||
"build": "microbundle --compress=false"
|
||||
}
|
||||
}
|
||||
5
test/fixtures/basic-compress-false/src/index.js
vendored
Normal file
5
test/fixtures/basic-compress-false/src/index.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { two } from './two';
|
||||
|
||||
export default async function(...args) {
|
||||
return [await two(...args), await two(...args)];
|
||||
}
|
||||
3
test/fixtures/basic-compress-false/src/two.js
vendored
Normal file
3
test/fixtures/basic-compress-false/src/two.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export async function two(...args) {
|
||||
return args.reduce((total, value) => total + value, 0);
|
||||
}
|
||||
2
test/fixtures/basic-no-compress/package.json
vendored
2
test/fixtures/basic-no-compress/package.json
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "basic-no-compress",
|
||||
"scripts": {
|
||||
"build": "microbundle --compress=false"
|
||||
"build": "microbundle --no-compress"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user