Skip to content

Commit 6661ac2

Browse files
committed
fix: fix --force flag
1 parent a6bc78e commit 6661ac2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/@vue/cli-plugin-typescript/__tests__/tsPluginClassComponent.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const options = {
1010
}
1111
}
1212

13-
assertServe('ts-default-serve', options)
14-
assertBuild('ts-default-build', options, async (project) => {
13+
assertServe('ts-class-serve', options)
14+
assertBuild('ts-class-build', options, async (project) => {
1515
const app = await project.read('src/App.vue')
1616
expect(app).toMatch(`export default class App extends Vue {`)
1717
})

packages/@vue/cli/bin/vue.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ function cleanArgs (cmd) {
127127
const args = {}
128128
cmd.options.forEach(o => {
129129
const key = o.long.replace(/^--/, '')
130-
if (typeof cmd[key] === 'string') {
130+
// if an option is not present and Command has a method with the same name
131+
// it should not be copied
132+
if (typeof cmd[key] !== 'function') {
131133
args[key] = cmd[key]
132134
}
133135
})

0 commit comments

Comments
 (0)