From e3e654682776325df5f0ea41588b7d02276c8b3b Mon Sep 17 00:00:00 2001 From: Elijah Kotyluk Date: Wed, 24 Aug 2022 13:11:17 -0700 Subject: [PATCH] fix(vuetify-cli): generate vite config file for vite projects --- packages/vue-cli-plugin-vuetify/generator/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/vue-cli-plugin-vuetify/generator/index.js b/packages/vue-cli-plugin-vuetify/generator/index.js index e140bdb..0e83959 100644 --- a/packages/vue-cli-plugin-vuetify/generator/index.js +++ b/packages/vue-cli-plugin-vuetify/generator/index.js @@ -30,6 +30,7 @@ module.exports = (api, opts) => { // Vite if (opts.useVite) { vite.addDependencies(api) + vite.renderFiles(api, opts) } if (opts.installFonts) fonts.addDependencies(api, opts.iconFont) @@ -42,11 +43,6 @@ module.exports = (api, opts) => { // adapted from https://github.com/Akryum/vue-cli-plugin-apollo/blob/master/generator/index.js#L68-L91 api.onCreateComplete(() => { - // Vite - if (opts.useVite) { - vite.renderFiles(api, opts) - } - if (!opts.useAlaCarte && opts.usePolyfill) { polyfill.updateBabelConfig(api) polyfill.updateBrowsersList(api) @@ -55,8 +51,8 @@ module.exports = (api, opts) => { if (!opts.installFonts) fonts.addLinks(api, opts.iconFont) vuetify.setHtmlLang(api, opts.locale) - if (fileExists(api, './src/public/index.html')) { - fs.unlinkSync(api.resolve('./src/public/index.html')) + if (fileExists(api, './public/index.html') && opts.useVite) { + fs.unlinkSync(api.resolve('./public/index.html')) } const configFile = api.resolve('./vue.config.js')