Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit 37e1fd8

Browse files
committed
refactor(update-file): support ts.
1 parent f967f85 commit 37e1fd8

File tree

1 file changed

+5
-3
lines changed
  • packages/@vuetify/cli-plugin-utils

1 file changed

+5
-3
lines changed

packages/@vuetify/cli-plugin-utils/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function generatePreset (api, preset, onCreateComplete) {
6969
const plugin = api.resolve(file)
7070

7171
if (!fs.existsSync(plugin)) {
72-
console.warn(`Unable to locate vuetify.${ext} plugin file in src/plugins.`)
72+
console.warn(`Unable to locate 'vuetify.${ext}' plugin file in 'src/plugins'.`)
7373

7474
return
7575
}
@@ -121,7 +121,9 @@ function updateFile (api, file, callback) {
121121

122122
// Add new property to the Vuetify object
123123
function updateVuetifyObject (api, value) {
124-
updateFile(api, 'src/plugins/vuetify.js', content => {
124+
const ext = api.hasPlugin('typescript') ? 'ts' : 'js'
125+
126+
updateFile(api, `src/plugins/vuetify.${ext}`, content => {
125127
const existingValue = str => (
126128
str.indexOf(`${value},`) > -1 ||
127129
str.indexOf(`${value}:`) > -1
@@ -138,7 +140,7 @@ function updateVuetifyObject (api, value) {
138140
const vuetify = content[index]
139141

140142
if (!vuetify) {
141-
console.warn('Unable to locate Vuetify instantiation in `src/plugins/vuetify.js`.')
143+
console.warn(`Unable to locate Vuetify instantiation in 'src/plugins/vuetify.${ext}'.`)
142144

143145
return
144146
}

0 commit comments

Comments
 (0)