File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ export interface ResolvedOptions extends Options {
63
63
compiler : typeof _compiler
64
64
root : string
65
65
sourceMap : boolean
66
+ cssDevSourcemap : boolean
66
67
devServer ?: ViteDevServer
67
68
devToolsEnabled ?: boolean
68
69
}
@@ -99,6 +100,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
99
100
reactivityTransform,
100
101
root : process . cwd ( ) ,
101
102
sourceMap : true ,
103
+ cssDevSourcemap : false ,
102
104
devToolsEnabled : process . env . NODE_ENV !== 'production'
103
105
}
104
106
@@ -137,6 +139,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
137
139
...options ,
138
140
root : config . root ,
139
141
sourceMap : config . command === 'build' ? ! ! config . build . sourcemap : true ,
142
+ cssDevSourcemap : config . css ?. devSourcemap ?? false ,
140
143
isProduction : config . isProduction ,
141
144
devToolsEnabled :
142
145
! ! config . define ! . __VUE_PROD_DEVTOOLS__ || ! config . isProduction
Original file line number Diff line number Diff line change @@ -23,13 +23,17 @@ export async function transformStyle(
23
23
isProd : options . isProduction ,
24
24
source : code ,
25
25
scoped : block . scoped ,
26
- postcssOptions : {
27
- map : {
28
- from : filename ,
29
- inline : false ,
30
- annotation : false
31
- }
32
- }
26
+ ...( options . cssDevSourcemap
27
+ ? {
28
+ postcssOptions : {
29
+ map : {
30
+ from : filename ,
31
+ inline : false ,
32
+ annotation : false
33
+ }
34
+ }
35
+ }
36
+ : { } )
33
37
} )
34
38
35
39
if ( result . errors . length ) {
You can’t perform that action at this time.
0 commit comments