Best practice to enable npm interface for interface with css / js?

I just started using NPM, Gulp, etc. So far, I only had NPM packages that either consisted only of JS or CSS / SASS. What I did, depending on the package:

  • copy the supplier’s catalog into the package so that I can work with it (in the case of bourbon)
  • just let gulp grab the file and merge it into my main.js or main.css

Now I have a fancybox NPM package that consists of CSS and JS. Should I also just take CSS separately from JS and process it (copy, merge, rename, etc.)?

After reading several blogs about working with NPM packages (Frontend), I'm still not sure what the best way to handle such a package is.

Ideas?

+4
source share
1 answer

Well, suppose everything depends on the package installed in node_modules (or subwoofers).

You can include both css and js files in the corresponding vendor.css and vendor.js files that are created by your build system.

I would prefer not to copy it to some vendor folder, but directly to the vendor file.

0
source

Source: https://habr.com/ru/post/1613500/


All Articles