@@ -3,11 +3,10 @@ import { dirname, relative, resolve } from 'node:path';
33import {
44 contentPlaceholder ,
55 digestPlaceholder ,
6- emptySourceMap ,
76 pluginCssNamespace ,
87 validateNamedExport
98} from './utils.js' ;
10- import { camelCase , sortBy , uniq , uniqBy , upperFirst } from 'lodash-es' ;
9+ import { camelCase , sortBy , uniqBy , upperFirst } from 'lodash-es' ;
1110import { injectorVirtualPath , pluginJsNamespace } from './utils.js' ;
1211import { readFileSync } from 'node:fs' ;
1312
@@ -235,9 +234,6 @@ ${uniqNames.map(([o, l]) => ` "${o}": ${l}`).join(',\n')}
235234 ` ) ;
236235 }
237236
238- // https://github.com/evanw/esbuild/issues/1227
239- jsLines . push ( `//${ emptySourceMap } ` ) ;
240-
241237 const jsContents = jsLines . join ( '\n' ) ;
242238
243239 return { js : jsContents , dts : emitDts ? dtsLines . join ( '\n' ) : undefined } ;
@@ -268,12 +264,14 @@ ${uniqNames.map(([o, l]) => ` "${o}": ${l}`).join(',\n')}
268264 } ,
269265 errorRecovery : true ,
270266 minify : false ,
271- sourceMap : ! ! this . build . initialOptions . sourcemap ,
267+ sourceMap : false ,
272268 projectRoot : this . build . context . buildRoot ,
273269 targets : {
274270 chrome : 112 << 16
275271 }
276272 } ;
273+ /** @type {{code: Buffer, exports: import('lightningcss').CSSModuleExports} } */
274+ // @ts -ignore
277275 const r = bundleModulesCss ( bundleCssConfig ) ;
278276
279277 const t = transform ( { ...bundleCssConfig , code : readFileSync ( fullpath ) } ) ;
@@ -289,7 +287,7 @@ ${uniqNames.map(([o, l]) => ` "${o}": ${l}`).join(',\n')}
289287 } ) ;
290288 } ) ;
291289
292- const { code, map : sourcemap , exports } = r ;
290+ const { code, exports } = r ;
293291
294292 let originCss = code ? code . toString ( 'utf8' ) : '' ;
295293
@@ -324,15 +322,10 @@ ${uniqNames.map(([o, l]) => ` "${o}": ${l}`).join(',\n')}
324322 originCss = outputFiles . find ( ( f ) => f . path . endsWith ( `stdin.css` ) ) ?. text ?? originCss ;
325323 }
326324
327- const css =
328- originCss +
329- ( sourcemap
330- ? `\n/*# sourceMappingURL=data:application/json;base64,${ sourcemap . toString ( 'base64' ) } */`
331- : '' ) ;
332325 const { js, dts } = this . genModulesJs ( exports , fullpath , ! ! opt ?. emitDeclarationFile ) ;
333326 /** @type {{css: string; js: string; dts?: string; composedFiles: string[]} } */
334327 const result = {
335- css,
328+ css : originCss ,
336329 composedFiles,
337330 js,
338331 dts
0 commit comments