Build js, redjs builder
Something about the introduction
Since I still quit my job and have free time, I’ll tell you a little about building scripts, as well as about my makeshift solution a year ago - redjs builder. The article will probably be of interest to js developers who lead large projects that are not convenient to run in a single file.
What are you talking about?
If you are a js developer and in your life you wrote something more than a slider plugin on jquery, then you probably came up with the thought: "but it would be convenient if you split a 1-n file into several." And I had such an idea more than once, even when I was actively writing my own js library . And then at one time I filled my sides ...
A little about this about seven builders
To begin with, it should be said in what cases a builder is generally needed.
During my practice, I met 4 types of projects:
- Any library
- Blociks, personal pages and other evil spirits
- Rich frontend multi-page projects
- Single-page applications
If you write your library, as a rule, in most cases, its assembly (if it is large enough) falls on your shoulders. In other cases, the preparation of scripts for release is often provided by the server side (but unfortunately not always). It makes sense to use the builder in the 2nd and 3rd cases to reduce the number of requests to the server. In the 3rd case, however, usually the scripts are not compiled into one, but into several files, since all the code in one file is too bold. Single-page applications, with proper architecture, store most of the code in separate modules and supposedly do not require explicit use of the js assembly.
I’ll say that in essence there are 2 types of assembly:
- bonding file contents
- translation of some kind of internal syntax
What builders have I seen?
- Very simple (bat file)
- Universal, phased, but long customizable ( Ant )
- Specialized ( GWT )
- Builders in scripting languages (in php, nodejs)
I must say that as builders they all did not suit me ... I would prefer something like php but more simple and unobtrusive. I also wanted a boxed solution. And some additional features.
Redjs builder

download here
A very simple program written in C # ( yes it depends on windows, for 7 matches it does not require any additional gestures ).
With permission, I will list some features and advantages:
- the ability to put on startup (when you start the system immediately in the tray)
- assembling a js file from several, and not just gluing and replacing tokens
- the token syntax is made in the style of comments, which does not distract from the code, does not break the backlight
- strict and non-strict inclusion. non-strict can be excluded from the assembly tree
- auto build when changing files
- the possibility of building in several places at once
- code minification
All my js projects are built by him.
To look at the program in action, you can download one of them, for example ree . In the builder (which you also need to download and unzip), you need to specify input - the main file from the source folder (in my projects it matches the name of the project), output - the compiled version will be created in the place of the code.
The syntax of the instructions can be viewed both in the builder itself and on the website in the documentation .
I am really pleased that I wrote this builder, although I spent a fair amount of time (without knowing C #, then that). At the moment, the program is working regularly for me on 10 projects, both open and closed.
What is the status now
In fact, despite its merits, this version (2) is out of date in my eyes in just a couple of weeks of use. She has her own flaws in ideology, as well as a couple of bugs that, due to my inexperience at the time of writing (in WPF and C #), are now difficult to fix.
At the moment, I already have two versions of the builder with a nameplate 3, which is devoid of many shortcomings supplemented with buns and sweets. In the near future I plan to finish.
For any feedback / criticism / suggestions I will be grateful.
Ctrl + B