Commit eab3f4d5 authored by devjiwonchoi's avatar devjiwonchoi

Revert "Revert "test: [breaking] esm test need ts extension and with json assertion for imports""

This reverts commit 5d33ee6fe7a987ed1632476c5f7db2a24439de61.
parent 66ca7939
import type { NextConfig } from 'next'
import { foo } from '@/foo.ts'
const nextConfig: NextConfig = {
env: {
foo,
},
}
export default nextConfig
export default function Page() {
return <p>{process.env.foo}</p>
}
{
"compilerOptions": {
"allowImportingTsExtensions": true,
"paths": {
// path should be relative when baseUrl is not set
"@/*": ["./src/*"]
}
}
}
import type { NextConfig } from 'next'
import { foo } from '@/foo.ts'
import { bar } from 'bar.ts'
const nextConfig: NextConfig = {
env: {
foo,
bar,
},
}
export default nextConfig
export default function Page() {
return <p>{`${process.env.foo + process.env.bar}`}</p>
}
{
"compilerOptions": {
"allowImportingTsExtensions": true,
"paths": {
// path can be not relative when baseUrl is set
"@/*": ["src/*"]
},
"baseUrl": "."
}
}
export default function Root({ children }: { children: React.ReactNode }) {
return (
<html>
<body>{children}</body>
</html>
)
}
export default function Root({ children }: { children: React.ReactNode }) {
return (
<html>
<body>{children}</body>
</html>
)
}
export default function Page() {
return <p>{process.env.foo}</p>
}
import type { NextConfig } from 'next'
import fooJson from './foo.json' with { type: 'json' }
export default {
env: {
foo: fooJson.foo,
},
} satisfies NextConfig
export default function Root({ children }: { children: React.ReactNode }) {
return (
<html>
<body>{children}</body>
</html>
)
}
export default function Root({ children }: { children: React.ReactNode }) {
return (
<html>
<body>{children}</body>
</html>
)
}
export default function Page() {
return <p>{process.env.foobarbaz}</p>
}
import { baz } from './baz.ts'
export const barbaz = 'bar' + baz
import { barbaz } from './bar.ts'
export const foobarbaz = 'foo' + barbaz
import type { NextConfig } from 'next'
import { foobarbaz } from './foo.ts'
const nextConfig: NextConfig = {
env: {
foobarbaz,
},
}
export default nextConfig
{
"compilerOptions": {
"allowImportingTsExtensions": true
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment