File tree 2 files changed +6
-10
lines changed
packages/vite/src/node/plugins
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -180,12 +180,9 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
180
180
const file = checkPublicFile ( id , config ) || cleanUrl ( id )
181
181
this . addWatchFile ( file )
182
182
// raw query, read file and return as string
183
- return {
184
- code : `export default ${ JSON . stringify (
185
- await fsp . readFile ( file , 'utf-8' ) ,
186
- ) } `,
187
- moduleType : 'js' , // TODO: remove later when not needed
188
- }
183
+ return `export default ${ JSON . stringify (
184
+ await fsp . readFile ( file , 'utf-8' ) ,
185
+ ) } `
189
186
}
190
187
191
188
if ( ! urlRE . test ( id ) && ! config . assetsInclude ( cleanUrl ( id ) ) ) {
@@ -216,7 +213,6 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
216
213
? 'no-treeshake'
217
214
: false ,
218
215
meta : config . command === 'build' ? { 'vite:asset' : true } : undefined ,
219
- moduleType : 'js' , // TODO: remove later when not needed
220
216
}
221
217
} ,
222
218
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export function jsonPlugin(
71
71
return {
72
72
code,
73
73
map : { mappings : '' } ,
74
- moduleType : 'js' , // TODO: remove later when not needed
74
+ moduleType : 'js' ,
75
75
}
76
76
}
77
77
@@ -90,7 +90,7 @@ export function jsonPlugin(
90
90
return {
91
91
code : `export default JSON.parse(${ JSON . stringify ( json ) } )` ,
92
92
map : { mappings : '' } ,
93
- moduleType : 'js' , // TODO: remove later when not needed
93
+ moduleType : 'js' ,
94
94
}
95
95
}
96
96
}
@@ -101,7 +101,7 @@ export function jsonPlugin(
101
101
namedExports : options . namedExports ,
102
102
} ) ,
103
103
map : { mappings : '' } ,
104
- moduleType : 'js' , // TODO: remove later when not needed
104
+ moduleType : 'js' ,
105
105
}
106
106
} catch ( e ) {
107
107
const position = extractJsonErrorPosition ( e . message , json . length )
You can’t perform that action at this time.
0 commit comments