Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also removeExtensionFromRelativeAmdId in UMD finaliser
- Loading branch information
1 parent
fd809d5
commit 3bcd1cd
Showing
5 changed files
with
14 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted. | ||
// The assumption is that this makes sense for all relative ids: | ||
// https://requirejs.org/docs/api.html#jsfiles | ||
export default function removeExtensionFromRelativeAmdId(id: string) { | ||
if (id[0] === '.' && id.endsWith('.js')) { | ||
return id.slice(0, -3); | ||
} | ||
return id; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/form/samples/relative-external-with-global/_expected/umd.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters