Swiip / generator-gulp-angular

Yeoman generator for AngularJS with GulpJS [UNMAINTAINED next iteration is FountainJS]
http://fountainjs.io
3.72k stars 665 forks source link

How to automatically import files when ES6 is used #817

Open mrafalkoitr opened 9 years ago

mrafalkoitr commented 9 years ago

Not an issue, this is a question. I can't find information among other issues and in the documentation.

When I use ES6 (Babel) then I must manually import all classes to index.module.js file and add a dependency to the module.

Is it possible to automate this task like it already done for plain js and coffee?

Swiip commented 9 years ago

There is no automatic mechanism to make your imports. I don't think I want to have this.

maks-rafalko commented 9 years ago

Could you please explain why you don't want it? It would improve DX (developer experience).

It's very easy to create new controller and already have it 'imported' when you use e.g. coffeescript, but when you use ES6 you also need to add dependency manually in index.module.js.

Swiip commented 9 years ago

Defining your module like here https://github.com/Swiip/generator-gulp-angular/blob/master/app/templates/src/app/_index.module.es6 mix import and angular registration.

I like this notation. Do we need yet another auto import that people don't understand well?

But I'm not entirely opposed. I agree it can be painful to write all imports...

Before a too long debate. Is there a good gulp plugin to do that?

maks-rafalko commented 9 years ago

Unfortunately, I did not find such plugin :(

Swiip commented 9 years ago

We never started writing a gulp plugin for a generator need. This is too much an investment for us. So I think this close the debate at least for now.