Skip to content

Commit

Permalink
Enabled some basic output settings for babel to produce leaner output…
Browse files Browse the repository at this point in the history
… by default. Adjusted tests for reversing this, though.
  • Loading branch information
swernerx committed Jun 22, 2017
1 parent dea1b7f commit f47596e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import buildPreset from "../src"

const options = buildPreset(null, { modules: false, target: { browsers: "ie 11" } })

// Keep formatting for tests (to keep output/diffs readable)
options.minified = false
options.compact = false

test("ES2015: Classes", () => {
expect(transform(`class Component{ main() { } }`, options).code).toMatchSnapshot()
})
Expand Down
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ export default function buildPreset(context, opts = {})

// Assemble final config
return {
// Just some basic minification
comments: false,
compact: true,
minified: true,

// Enable source maps by default
sourceMaps: true,

// And all the previously built lists of presets and plugins
presets,
plugins
}
Expand Down

0 comments on commit f47596e

Please sign in to comment.