Skip to content

Commit 1d9dfd2

Browse files
committed
add --no-flat / flat:false option
1 parent 0170269 commit 1d9dfd2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ module.exports = function (b, opts) {
1010
throw new Error('tinyify: must be used as a plugin, not a transform')
1111
}
1212

13-
opts = opts || {}
13+
opts = Object.assign({
14+
flat: true
15+
}, opts)
1416

1517
var env = Object.assign({
1618
NODE_ENV: 'production'
@@ -32,7 +34,10 @@ module.exports = function (b, opts) {
3234
})
3335

3436
// Output a flat bundle, without function wrappers for each module.
35-
b.plugin(packFlat)
37+
if (opts.flat) {
38+
b.plugin(packFlat)
39+
}
40+
3641
// Remove unused exports from modules.
3742
b.plugin(commonShake)
3843

0 commit comments

Comments
 (0)