@@ -370,7 +370,7 @@ test('overwrite bindings', async () => {
370370 `const a = { inject }\n` +
371371 `const b = { test: inject }\n` +
372372 `function c() { const { test: inject } = { test: true }; console.log(inject) }\n` +
373- `const d = inject \n` +
373+ `const d = inject\n` +
374374 `function f() { console.log(inject) }\n` +
375375 `function e() { const { inject } = { inject: true } }\n` +
376376 `function g() { const f = () => { const inject = true }; console.log(inject) }\n` ,
@@ -383,7 +383,7 @@ test('overwrite bindings', async () => {
383383 const a = { inject: __vite_ssr_import_0__.inject }
384384 const b = { test: __vite_ssr_import_0__.inject }
385385 function c() { const { test: inject } = { test: true }; console.log(inject) }
386- const d = __vite_ssr_import_0__.inject
386+ const d = __vite_ssr_import_0__.inject
387387 function f() { console.log(__vite_ssr_import_0__.inject) }
388388 function e() { const { inject } = { inject: true } }
389389 function g() { const f = () => { const inject = true }; console.log(__vite_ssr_import_0__.inject) }
@@ -719,3 +719,20 @@ export default (function getRandom() {
719719 ( await ssrTransform ( `export default (class A {});` , null , null ) ) . code
720720 ) . toMatchInlineSnapshot ( `"__vite_ssr_exports__.default = (class A {});"` )
721721} )
722+
723+ // #8002
724+ test ( 'with hashbang' , async ( ) => {
725+ expect (
726+ (
727+ await ssrTransform (
728+ `#!/usr/bin/env node
729+ console.log("it can parse the hashbang")` ,
730+ null ,
731+ null
732+ )
733+ ) . code
734+ ) . toMatchInlineSnapshot ( `
735+ "#!/usr/bin/env node
736+ console.log(\\"it can parse the hashbang\\")"
737+ ` )
738+ } )
0 commit comments