Skip to content

Skip files from package.json "main" or "types" if they have an unsupported extension.#13024

Merged
mhegazy merged 2 commits intomasterfrom
package_json_unsupported_extension
Dec 20, 2016
Merged

Skip files from package.json "main" or "types" if they have an unsupported extension.#13024
mhegazy merged 2 commits intomasterfrom
package_json_unsupported_extension

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Dec 19, 2016

Fixes #13004
The problem there is that the normalize.css module lists a file "normalize.css" as its "main" entry point.

@ghost
Copy link
Copy Markdown
Author

ghost commented Dec 19, 2016

Will need to rebase onto #13025 (when it's merged) to fix tests.

Comment thread src/compiler/moduleNameResolver.ts Outdated
return resolvedFromAnyFile(fromFile);
const fromExactFile = tryFile(mainOrTypesFile, failedLookupLocations, onlyRecordFailures, state);
if (fromExactFile) {
const resolved = fromExactFile && resolvedFromSuspiciousFile(extensions, fromExactFile);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd name it resolveIfExtensionMatches

@mhegazy mhegazy merged commit 328a5ef into master Dec 20, 2016
@mhegazy mhegazy deleted the package_json_unsupported_extension branch December 20, 2016 23:44
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants