Skip to content

Commit

Permalink
fix(vuetify-cli): generate vite config file for vite projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahKotyluk committed Aug 24, 2022
1 parent 8e10dde commit e3e6546
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/vue-cli-plugin-vuetify/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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')
Expand Down

0 comments on commit e3e6546

Please sign in to comment.