Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Support static template literals #271

Merged
merged 1 commit into from
Jan 26, 2018
Merged

Support static template literals #271

merged 1 commit into from
Jan 26, 2018

Conversation

adrianheine
Copy link
Contributor

Closes #265.

Copy link

@TehShrike TehShrike left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -91,14 +91,14 @@ export function transformCommonjs ( code, id, isEntry, ignoreGlobal, ignoreRequi
if ( !node ) return;
if ( node.type !== 'CallExpression' ) return;
if ( node.callee.name !== 'require' || scope.contains( 'require' ) ) return;
if ( node.arguments.length !== 1 || node.arguments[0].type !== 'Literal' ) return; // TODO handle these weird cases?
if ( node.arguments.length !== 1 || (node.arguments[0].type !== 'Literal' && (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0) ) ) return; // TODO handle these weird cases?

Choose a reason for hiding this comment

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

Since this template literal case is now handled at least to some degree, the comment seems a bit misleading... it can probably go, eh?

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

Goes into the next release. Thanks 👍 nice tests!

This pull request was closed.
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