Skip to content

Commit

Permalink
fix bug and test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Dec 9, 2024
1 parent 69a7500 commit 466d6b8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/napi/src/next_api/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ pub async fn project_trace_source(
(
get_relative_path_to(
&current_directory_file_url,
&format!("{}/{}", project_root_uri, source_file),
&format!("{}{}", project_root_uri, source_file),
)
// TODO(sokra) remove this to include a ./ here to make it a relative path
.trim_start_matches("./")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { text } from 'my-package/typescript.ts'
import { text } from 'my-package/typescript'

export default function Page() {
return <p>{text}</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { text } from 'my-package/typescript.ts'
import { text } from 'my-package/typescript'

export default function Page() {
return <p>{text}</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export default async function Page({ searchParams }) {
innerFunction()
// We don't want the build to fail in production
if (process.env.NODE_ENV === 'development') {
innerFunction()
}
return <p>Hello Source Maps</p>
}

function innerFunction() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
'use client'

export default function Page() {
innerFunction()
// We don't want the build to fail in production
if (process.env.NODE_ENV === 'development') {
innerFunction()
}
return <p>Hello Source Maps</p>
}

function innerFunction() {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/css-minify/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function runTests() {
"/* [project]/test/integration/css-minify/styles/global.css [client] (css) */
.a{--var-1:0;--var-2:0;--var-1:-50%;--var-2:-50%}.b{--var-1:0;--var-2:0;--var-2:-50%}
/*# sourceMappingURL=styles_global_411632.css.map*/
/*# sourceMappingURL=test_integration_css-minify_styles_global_411632.css.map*/
"
`)
} else {
Expand Down

0 comments on commit 466d6b8

Please sign in to comment.