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

Support require instruction as module import #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gurobokum
Copy link

@gurobokum gurobokum commented May 16, 2019

Pull Request Description

Support require expression for being able to use dependant basegl-loader with source code which contains importing with require() syntax
For example in webpack loader chaining where previous one produces ES5 and bellow source code (by default TypeScript produces ES3)

Important Notes

  • Return signature of getAndRemoveLibImports has been changed: additional VariableDeclaration node can appear in the list
  • gulp dependency tag has been changed from next to latest cause next is missed in https://registry.npmjs.org

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • The code conforms to the Luna TypeScript Style Guide.
  • The code has been tested where possible.

@gurobokum
Copy link
Author

Let me clarify the main reason of the PR
Here if libRefs doesn't contain variable namespace name the callback isn't called
So basegl->expr is not parsed if basegl was declared as let basegl = require('basegl') what happens on ES3 webpack ts-loader processing

@iamrecursion iamrecursion requested a review from wdanilo May 17, 2019 10:28
@iamrecursion iamrecursion added Category: Preprocessor The JSNext preprocessor Change: Non-Breaking A non-breaking change to the library API Difficulty: Intermediate Some prior knowledge required Priority: Medium Should be fixed in the next few sprints Type: Bug A bug in JSNext labels May 17, 2019
@CLAassistant
Copy link

CLAassistant commented May 17, 2019

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Preprocessor The JSNext preprocessor Change: Non-Breaking A non-breaking change to the library API Difficulty: Intermediate Some prior knowledge required Priority: Medium Should be fixed in the next few sprints Type: Bug A bug in JSNext
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants