We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0170269 commit 1d9dfd2Copy full SHA for 1d9dfd2
index.js
@@ -10,7 +10,9 @@ module.exports = function (b, opts) {
10
throw new Error('tinyify: must be used as a plugin, not a transform')
11
}
12
13
- opts = opts || {}
+ opts = Object.assign({
14
+ flat: true
15
+ }, opts)
16
17
var env = Object.assign({
18
NODE_ENV: 'production'
@@ -32,7 +34,10 @@ module.exports = function (b, opts) {
32
34
})
33
35
36
// Output a flat bundle, without function wrappers for each module.
- b.plugin(packFlat)
37
+ if (opts.flat) {
38
+ b.plugin(packFlat)
39
+ }
40
+
41
// Remove unused exports from modules.
42
b.plugin(commonShake)
43
0 commit comments