From e7803b965040dcb1221cb7269fc460c85447724f Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Mon, 29 Jul 2019 19:57:18 +0200 Subject: [PATCH] fix: do not generate empty file The recent refactoring in #4330 introduced a regression where a `Home.vue` file was generated if using the TS plugin even without the router plugin. This happened because the result from the ejs rendering was `undefined`. This fixes the issue by returning an empty string instead, which will not be written. --- .../__tests__/tsGenerator.spec.js | 18 ++++++++++++++++++ packages/@vue/cli/lib/GeneratorAPI.js | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-plugin-typescript/__tests__/tsGenerator.spec.js b/packages/@vue/cli-plugin-typescript/__tests__/tsGenerator.spec.js index 8cc134cc88..d55ddaa0ee 100644 --- a/packages/@vue/cli-plugin-typescript/__tests__/tsGenerator.spec.js +++ b/packages/@vue/cli-plugin-typescript/__tests__/tsGenerator.spec.js @@ -17,6 +17,8 @@ test('generate files', async () => { expect(files['src/main.ts']).toBeTruthy() expect(files['src/main.js']).toBeFalsy() expect(files['src/App.vue']).toMatch('