From 12151d81d650d3043826a8e0706c3720f3625d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 2 Nov 2018 18:07:39 +0900 Subject: [PATCH] feat: add --modern to nuxt start (#4254) --- packages/babel-preset-app/src/index.js | 2 +- packages/cli/src/commands/start.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/babel-preset-app/src/index.js b/packages/babel-preset-app/src/index.js index db9673d723..f687cf60d0 100644 --- a/packages/babel-preset-app/src/index.js +++ b/packages/babel-preset-app/src/index.js @@ -39,7 +39,7 @@ module.exports = (context, options = {}) => { const { buildTarget, loose = false, - useBuiltIns = 'usage', + useBuiltIns = (modern ? false : 'usage'), modules = false, polyfills: userPolyfills, ignoreBrowserslistConfig = modern, diff --git a/packages/cli/src/commands/start.js b/packages/cli/src/commands/start.js index 506f0fe47f..2423bf5bb1 100644 --- a/packages/cli/src/commands/start.js +++ b/packages/cli/src/commands/start.js @@ -9,7 +9,18 @@ export default { usage: 'start ', options: { ...common, - ...server + ...server, + modern: { + alias: 'm', + type: 'boolean', + description: 'Build app for modern browsers', + prepare(cmd, options, argv) { + options.build = options.build || {} + if (argv.modern) { + options.build.modern = !!argv.modern + } + } + } }, async run(cmd) { const argv = cmd.getArgv()