Galooshi / import-js

A tool to simplify importing JS modules
MIT License
525 stars 55 forks source link

node_modules are ignored #493

Open GCorbel opened 6 years ago

GCorbel commented 6 years ago

I'm working on an ember project and I installed the addon ember-simple-auth. I create the app/authenticators/application.js with this :

export default Devise.extend({
});

Devise should be resolved asimport Devise from 'ember-simple-auth/authenticators/devise'; but it gives No JS module to import forDevise`.

The file is located in ./node_modules/ember-simple-auth/addon/authenticators/devise.js and the addon is a "devDependency".

It works if I create an app somewhere in my app with :

const Devise = {};
export { Devise };

Here is my .importjs.js file :

module.exports = {
  excludes: [],
  importDevDependencies: true
}

There is nothing in logs.

Is there a bug or did I miss something?

coagmano commented 6 years ago

I've been having similar issues, and haven't had the time to debug it properly

trotzig commented 6 years ago

Right now, only the top level exports are found for package dependencies. We've discussed adding support for finding exports within subdirectories of package dependencies, but no code has yet been written in this area. See https://github.com/Galooshi/import-js/issues/344

GCorbel commented 6 years ago

Any updates on this issue?

trotzig commented 6 years ago

@GCorbel nothing yet. If you wanted to get involved, #344 is a good place to discuss ways to implement this.