File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { isDev } from './isDev';
5
5
import { parse_ID } from './parse_ID' ;
6
6
import { transform } from './transform' ;
7
7
8
- export const unpluginFactory : UnpluginFactory < Options > = ( options = { } ) => {
8
+ export const unpluginFactory : UnpluginFactory < Options | undefined > = (
9
+ options = { } ,
10
+ meta ,
11
+ ) => {
9
12
if ( ! isDev ( ) ) {
10
13
return {
11
14
name : 'unplugin-vue-source' ,
@@ -14,6 +17,7 @@ export const unpluginFactory: UnpluginFactory<Options> = (options = {}) => {
14
17
15
18
const opts = resolveOptions ( options ) ;
16
19
const filter = createFilter ( opts . include , opts . exclude ) ;
20
+ const isWebpack = meta . framework === 'webpack' ;
17
21
18
22
return {
19
23
name : 'unplugin-vue-source' ,
@@ -24,7 +28,7 @@ export const unpluginFactory: UnpluginFactory<Options> = (options = {}) => {
24
28
return query . raw == null && filter ( file ) ;
25
29
} ,
26
30
transform ( code , id ) {
27
- return transform ( code , id , opts ) ;
31
+ return transform ( code , id , opts , isWebpack ) ;
28
32
} ,
29
33
} ;
30
34
} ;
Original file line number Diff line number Diff line change @@ -7,13 +7,18 @@ import { transform_SFC } from './transform_SFC';
7
7
import { transform_MDX } from './transform_MDX' ;
8
8
import { transform_JSX } from './transform_JSX' ;
9
9
10
- export function transform ( code : string , id : string , opts : ResolvedOptions ) {
10
+ export function transform (
11
+ code : string ,
12
+ id : string ,
13
+ opts : ResolvedOptions ,
14
+ isWebpack = false ,
15
+ ) {
11
16
const { root, sourceMap } = opts ;
12
17
13
18
let s : MagicString ;
14
19
const parsed = parse_ID ( id , root ) ;
15
20
16
- if ( parsed . query [ TRACE_ID ] ) {
21
+ if ( ! isWebpack && parsed . query [ TRACE_ID ] ) {
17
22
return ;
18
23
}
19
24
You can’t perform that action at this time.
0 commit comments