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'
22import vuetify from 'vite-plugin-vuetify'
33import path from 'path'
44import Inspect from 'vite-plugin-inspect'
5+ import { defineConfig } from 'vite'
56
6- export default {
7+ export default defineConfig ( ( { command } ) => ( {
78 root : path . resolve ( __dirname , 'src' ) ,
89 plugins : [
910 vue ( ) ,
10- vuetify ( { styles : 'expose' } ) ,
11+ vuetify ( { styles : 'expose' , autoImport : true } ) ,
1112 {
1213 name : 'configure-server' ,
1314 configureServer ( server ) {
@@ -22,10 +23,12 @@ export default {
2223 // Inspect(),
2324 ] ,
2425 build : {
26+ sourcemap : true ,
27+ minify : false ,
2528 outDir : '../dist' ,
2629 emptyOutDir : true ,
2730 rollupOptions : {
28- input : ' index.vite.html'
31+ input : { build : 'src/ index.vite.html', serve : 'index.vite.html' } [ command ] ,
2932 }
3033 } ,
3134 resolve : {
@@ -43,4 +46,4 @@ export default {
4346 optimizeDeps : {
4447 exclude : [ 'vuetify' ]
4548 }
46- }
49+ } ) )
Original file line number Diff line number Diff line change @@ -22,16 +22,16 @@ export function importPlugin (): Plugin {
2222 } ,
2323 async transform ( code , id ) {
2424 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- }
2925
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+ ) {
3030 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+ }
3535 }
3636
3737 return null
Original file line number Diff line number Diff line change @@ -168,7 +168,10 @@ export function stylesPlugin (options: Options): Plugin {
168168 await awaitResolve ( id )
169169 debug ( `returning ${ id } ` )
170170
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+ }
172175 }
173176 } ,
174177 load ( id ) {
You can’t perform that action at this time.
0 commit comments