From 6661ac24ac82b6fce4e753123a21efa083d822ca Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 2 Feb 2018 01:12:19 -0500 Subject: [PATCH] fix: fix --force flag --- .../__tests__/tsPluginClassComponent.spec.js | 4 ++-- packages/@vue/cli/bin/vue.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/@vue/cli-plugin-typescript/__tests__/tsPluginClassComponent.spec.js b/packages/@vue/cli-plugin-typescript/__tests__/tsPluginClassComponent.spec.js index 7eb017b54a..1decff1098 100644 --- a/packages/@vue/cli-plugin-typescript/__tests__/tsPluginClassComponent.spec.js +++ b/packages/@vue/cli-plugin-typescript/__tests__/tsPluginClassComponent.spec.js @@ -10,8 +10,8 @@ const options = { } } -assertServe('ts-default-serve', options) -assertBuild('ts-default-build', options, async (project) => { +assertServe('ts-class-serve', options) +assertBuild('ts-class-build', options, async (project) => { const app = await project.read('src/App.vue') expect(app).toMatch(`export default class App extends Vue {`) }) diff --git a/packages/@vue/cli/bin/vue.js b/packages/@vue/cli/bin/vue.js index 21bc86de4f..75020342b2 100755 --- a/packages/@vue/cli/bin/vue.js +++ b/packages/@vue/cli/bin/vue.js @@ -127,7 +127,9 @@ function cleanArgs (cmd) { const args = {} cmd.options.forEach(o => { const key = o.long.replace(/^--/, '') - if (typeof cmd[key] === 'string') { + // if an option is not present and Command has a method with the same name + // it should not be copied + if (typeof cmd[key] !== 'function') { args[key] = cmd[key] } })