File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,13 @@ import vue from '@vitejs/plugin-vue'
2
2
import vuetify from 'vite-plugin-vuetify'
3
3
import path from 'path'
4
4
import Inspect from 'vite-plugin-inspect'
5
+ import { defineConfig } from 'vite'
5
6
6
- export default {
7
+ export default defineConfig ( ( { command } ) => ( {
7
8
root : path . resolve ( __dirname , 'src' ) ,
8
9
plugins : [
9
10
vue ( ) ,
10
- vuetify ( { styles : 'expose' } ) ,
11
+ vuetify ( { styles : 'expose' , autoImport : true } ) ,
11
12
{
12
13
name : 'configure-server' ,
13
14
configureServer ( server ) {
@@ -22,10 +23,12 @@ export default {
22
23
// Inspect(),
23
24
] ,
24
25
build : {
26
+ sourcemap : true ,
27
+ minify : false ,
25
28
outDir : '../dist' ,
26
29
emptyOutDir : true ,
27
30
rollupOptions : {
28
- input : ' index.vite.html'
31
+ input : { build : 'src/ index.vite.html', serve : 'index.vite.html' } [ command ] ,
29
32
}
30
33
} ,
31
34
resolve : {
@@ -43,4 +46,4 @@ export default {
43
46
optimizeDeps : {
44
47
exclude : [ 'vuetify' ]
45
48
}
46
- }
49
+ } ) )
Original file line number Diff line number Diff line change @@ -22,16 +22,16 @@ export function importPlugin (): Plugin {
22
22
} ,
23
23
async transform ( code , id ) {
24
24
const { query, path } = parseId ( id )
25
- if ( extname ( path ) === '.vue' && ! query ) {
26
- if ( / ^ i m p o r t { r e n d e r a s _ s f c _ r e n d e r } f r o m " .* " $ / m. test ( code ) ) {
27
- return null
28
- }
29
25
26
+ if (
27
+ ( ! query && extname ( path ) === '.vue' && ! / ^ i m p o r t { r e n d e r a s _ s f c _ r e n d e r } f r o m " .* " $ / m. test ( code ) ) ||
28
+ ( query && 'vue' in query && query . type === 'template' )
29
+ ) {
30
30
const { code : imports , source } = generateImports ( code )
31
- return source + imports
32
- } else if ( query && 'vue' in query && query . type === 'template' ) {
33
- const { code : imports , source } = generateImports ( code )
34
- return source + imports
31
+ return {
32
+ code : source + imports ,
33
+ map : null ,
34
+ }
35
35
}
36
36
37
37
return null
Original file line number Diff line number Diff line change @@ -168,7 +168,10 @@ export function stylesPlugin (options: Options): Plugin {
168
168
await awaitResolve ( id )
169
169
debug ( `returning ${ id } ` )
170
170
171
- return code . replace ( styleImportRegexp , '$1".cache/vuetify/styles.scss"' )
171
+ return {
172
+ code : code . replace ( styleImportRegexp , '$1".cache/vuetify/styles.scss"' ) ,
173
+ map : null ,
174
+ }
172
175
}
173
176
} ,
174
177
load ( id ) {
You can’t perform that action at this time.
0 commit comments