Skip to content

Commit

Permalink
use terser by default
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 5, 2020
1 parent b87ba7e commit 4fd2cdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ export async function build(options: BuildOptions = {}): Promise<BuildResult> {
resolver
)

// terser is used by default for better compression, but the user can also
// opt-in to use esbuild which is orders of magnitude faster.
const minifyPlugin = minify
? minify === 'terser'
? require('rollup-plugin-terser').terser()
: await createMinifyPlugin()
? minify === 'esbuild'
? await createMinifyPlugin()
: require('rollup-plugin-terser').terser()
: null

// lazy require rollup so that we don't load it when only using the dev server
Expand Down
1 change: 0 additions & 1 deletion src/node/esbuildService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const transform = async (
options: TransformOptions,
operation: string
) => {
console.log(operation)
try {
const result = await service.transform(code, options)
if (result.warnings.length) {
Expand Down

0 comments on commit 4fd2cdf

Please sign in to comment.