feat: add --modern to nuxt start (#4254)

This commit is contained in:
Sébastien Chopin 2018-11-02 18:07:39 +09:00 committed by Clark Du
parent 19287cce96
commit 12151d81d6
2 changed files with 13 additions and 2 deletions

View File

@ -39,7 +39,7 @@ module.exports = (context, options = {}) => {
const {
buildTarget,
loose = false,
useBuiltIns = 'usage',
useBuiltIns = (modern ? false : 'usage'),
modules = false,
polyfills: userPolyfills,
ignoreBrowserslistConfig = modern,

View File

@ -9,7 +9,18 @@ export default {
usage: 'start <dir>',
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()