Coder Social home page Coder Social logo

Works with import about atom-node-resolver2 HOT 5 OPEN

kikobeats avatar kikobeats commented on June 15, 2024
Works with import

from atom-node-resolver2.

Comments (5)

Kikobeats avatar Kikobeats commented on June 15, 2024

Yes currently ES6 doesn't work.

Related: https://twitter.com/Kikobeats/status/777872609530740736

Definitely I need charliedowler's help for resolve this 😄 .

from atom-node-resolver2.

charliedowler avatar charliedowler commented on June 15, 2024

Hi,

I switched back to esprima and tried sourceType as you suggested. Imports won't work until this function is rewritten

astw(ast)(function(node) {
      if (!isRequire(node)) return

It's looking for require statements instead of both require and import, I don't think upgrading node-resolver to fully support es6 is as simple as bumping the esprima dependency.

What do you think?

Cheers,
Charlie

from atom-node-resolver2.

Kikobeats avatar Kikobeats commented on June 15, 2024

Actually I don't know how to walk into the AST. If you feel confortable doing that I can add you as collaborator 😁

from atom-node-resolver2.

Kikobeats avatar Kikobeats commented on June 15, 2024

Hey,

I released a new patch version. I switch the package used for parsing the AST. Looks like we are near to get this working!

from atom-node-resolver2.

Kikobeats avatar Kikobeats commented on June 15, 2024

The current limitation is how to detect import.

This libraries uses https://github.com/hughsk/is-require/blob/master/index.js that very basic and it depends of the node that you pass.

I isolate the case in a little example: https://gist.github.com/Kikobeats/89168d73f57fd8e6c17c0effe1403987

Related: acornjs/acorn#441

from atom-node-resolver2.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.