Answer the question
In order to leave comments, you need to log in
Building the gulp project. How to inject css/js from node_modules conditionally and without wiredep?
People, show who uses what file structure and build system to start the layout of a web project? I shoveled a bunch of information, I did not find any definite solution. Whoever likes it, collect it. I came to the conclusion that I want to use gulp + sass + browserfy + browsersync (well, and other little things - images, html, etc.). And I want to somehow set up the assembly so that, depending on the flag , all scripts and styles are collected in one or two files. That is, if there are two files vendor.js(css) and main.js(css) . And with, respectively, everything would be collected in one file main.js (css) . And so that they are automatically injected into the specified place in the pug template. Browserfydev = true/false
dev = true
dev = false
can glue js files, including the necessary dependencies along the way. In sass , you can import the necessary sources of the connected library and it will also collect everything into one file. But these connections all need to be done manually. In the case of using bower , there is a wiredep plugin that automatically includes files from installed packages based on bowerjson settings . But bower is now moving into oblivion and is no longer recommended for use. And, accordingly, wiredep will no longer work with npm packages.
In short, the main question is is there any alternative to wiredep in case of installing all packages in node_modulesOr now these connections need to be done manually? And is it even possible to implement the assembly logic described above on gulp ? I know that webpack is much more powerful and flexible in this regard, but I don’t want to mess with it yet.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question