E
E
EvgenyKabakov2016-12-08 22:29:43
JavaScript
EvgenyKabakov, 2016-12-08 22:29:43

Are there Javascript preprocessors like Sass?

Good day to all!
I have been working with scss for some time, I find it very convenient to be able to create separate files for specific blocks, and then assemble the scss files into one css file.
In general, I get something like this structure:
styles / blocks / file.scss
styles / components / file.scss
styles / sassline / file.scss
main.css
, etc.
Actually, the question is: is there something similar for js so that you can make many separate js files and then collect them into one big file? it just becomes very inconvenient to end up looking for the desired function in a very long js file. Can someone advise how best to organize the structure of the js code on the project?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Wolf, 2016-12-08
@EvgenyKabakov

https://webpack.js.org - will change your understanding of file assembly in principle.

S
sim3x, 2016-12-08
@sim3x

Just glue all files into one
https://www.npmjs.com/package/gulp-concat-js
Do the same structure as sass

S
Sergey Zhubartovich, 2016-12-08
@BLVST

Just like you collect scss files, you can also collect js :)

Z
zooks, 2016-12-09
@zooks

You can try to include via gulp-rigger.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question