File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -184,12 +184,9 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
184
184
const file = checkPublicFile ( id , config ) || cleanUrl ( id )
185
185
this . addWatchFile ( file )
186
186
// raw query, read file and return as string
187
- return {
188
- code : `export default ${ JSON . stringify (
189
- await fsp . readFile ( file , 'utf-8' ) ,
190
- ) } `,
191
- moduleType : 'js' , // TODO: remove later when not needed
192
- }
187
+ return `export default ${ JSON . stringify (
188
+ await fsp . readFile ( file , 'utf-8' ) ,
189
+ ) } `
193
190
}
194
191
195
192
if ( ! urlRE . test ( id ) && ! config . assetsInclude ( cleanUrl ( id ) ) ) {
@@ -220,7 +217,6 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
220
217
? 'no-treeshake'
221
218
: false ,
222
219
meta : config . command === 'build' ? { 'vite:asset' : true } : undefined ,
223
- moduleType : 'js' , // TODO: remove later when not needed
224
220
}
225
221
} ,
226
222
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