vihanb / babel-plugin-wildcard

Wildcard imports import a directories JS files
MIT License
186 stars 27 forks source link

Add support to syntax `import {path}` #16

Open BenjaminVanRyseghem opened 6 years ago

BenjaminVanRyseghem commented 6 years ago

Currently, the following fails:

import "../widgets/actions";

while the following works

import * as Classes from "../widgets/actions";

In my case, just loading the files has the side-effect I want. I would like to avoid having an unused var.

vihanb commented 6 years ago

I believe in the latest version (3.0.0) you should be able to do import "../widgets/actions/*". Let me know if that does not work

BenjaminVanRyseghem commented 6 years ago

I got

Cannot find module '../widgets/actions' from '/Users/benjamin/work/project/src/helpers'
mitar commented 5 years ago

Works for me. You have to put * at the end. Like import "../widgets/actions/*";

BenjaminVanRyseghem commented 5 years ago

@mitar I changed company since, and I don't use this anymore :smile:

If @vihanb confirms it works, he can close this :smile: