eclipse-transpiler-plugin icon indicating copy to clipboard operation
eclipse-transpiler-plugin copied to clipboard

Dependency transpiling?

Open Ciantic opened this issue 9 years ago • 5 comments

Can I somehow make single transpiler to run for "/style.less" even when I change "/something/common.less"?

I've been using the Eclipse "native way" to do transpiling from LESS to CSS, it kind of works but does unnecessary runs at times. Neat thing is it can handle dependencies if one cares to list them. (Native way to do transpiling is to create project specific builder, set the launch program and select the files which by changing triggers that builder. Then turning on automatic builds, and it runs it when I change only those files)

Ciantic avatar Nov 04 '14 11:11 Ciantic

Unfortunately, this doesn't work and I must admit I didn't thought of this use-case when I developed the plugin, but I can see a need here.

I developed this plugin, after I manually used a shell script as a builder. This old procedere would help you in your case, see my post at stackoverflow: https://stackoverflow.com/questions/7686281/unnoticeable-lesscss-compiler-in-eclipse-pdt/9577888#9577888 All you need to do is to modify it to your needs and you are good to go.

I also keep this open, because I think this is an interessting and helpful addition.

Thank you

gossi avatar Nov 04 '14 12:11 gossi

Yeah that is the manual (native) way I've been doing it before this.

Though your plugin is much better, I can copy & paste, rename a project (I do this a lot) and it retains the transpilers because your plugin doesn't depend on project name. Maybe the dependency based building requires new feature for your plugin. I wouldn't mind checking all files the main file depends on, so no need to go fancy and automatically figure out the dependency tree.

Using manual builder it gets a hassle each time, and it sometimes runs when it shouldn't.

Ciantic avatar Nov 04 '14 15:11 Ciantic

What would be a good addition to this plugin is, to set up a transpiling, e.g. from x.less to y.css and add an option for a file to watch for changes to run the transpiling. Extending my example, it would also run the transpiling when base.less is changed as well.

Would you mind a PR for this?

gossi avatar Nov 06 '14 13:11 gossi

@gossi are you asking from me something? I mean I have no fork on which to pull, I'm just speculating a feature.

What you describe is what I described also — I think so. Listing additional files which by saving triggers the certain transpiler in the project.

Ciantic avatar Nov 06 '14 14:11 Ciantic

Here is how it could be done: On the project transpiler page, path section for a selected transpiler. Select a path entry and if it is a file, you can add more source files for this particular transpilation. The UI would be a TableTree then, with all the multiple source files nested under the original transpilation. So you'd need to add each imported file from your master as nested and it would work. You would need to rebuild your own import by yourself, auto-detecting is another story...

gossi avatar May 07 '15 18:05 gossi