Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support tsconfig.json file paths resolving #1212

Closed
MaxmaxmaximusAWS opened this issue Apr 27, 2021 · 1 comment
Closed

Add support tsconfig.json file paths resolving #1212

MaxmaxmaximusAWS opened this issue Apr 27, 2021 · 1 comment

Comments

@MaxmaxmaximusAWS
Copy link

MaxmaxmaximusAWS commented Apr 27, 2021

"bundle" option is false

tsconfig.json:

{
	"compilerOptions": {
		"target": "es5",
		"lib": [
			"dom",
			"dom.iterable",
			"esnext"
		],
		"allowJs": true,
		"skipLibCheck": true,
		"strict": false,
		"forceConsistentCasingInFileNames": true,
		"noEmit": true,
		"esModuleInterop": true,
		"module": "esnext",
		"moduleResolution": "node",
		"resolveJsonModule": true,
		"isolatedModules": true,
		"jsx": "preserve",
		"baseUrl": ".",
		"paths": {
			"@lib": [
				"src/lib"
			],
			"@lib/*": [
				"src/lib/*"
			],

		}
	},
	"include": [
		"next-env.d.ts",
		"**/*.ts",
		"**/*.tsx"
	],
	"exclude": [
		"node_modules",
		"scripts"
	]
}

index.ts:

import {lol} from "@lib/lol";
console.log(lol())

@lib/lol.ts:

export const lol = () => {
	return 'Hello!'
}

output file:

import{lol as l}from"@lib/lol";console.log(l());
//# sourceMappingURL=index.js.map

but must be:

output file:

import{lol as l}from"./lib/lol";console.log(l());
//# sourceMappingURL=index.js.map
@evanw
Copy link
Owner

evanw commented Apr 27, 2021

Closing as a duplicate of #394.

@evanw evanw closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants