user1340531
user1340531

Reputation: 740

Gulp less with images

Is there a way for gulp-less (or some other tool) to take the paths to images that are referenced in the .less/.css file and put the files to the destination folder?

Right now when I install a node module, I @import the css file from /node_modules/... directory to my main .less file and it will be included in the bundle, but the images that come with the module are still located under /node_modules/... folder which I don't plan to deploy so using a relative URL would be pointless.

Upvotes: 0

Views: 93

Answers (1)

xsh.7
xsh.7

Reputation: 6250

You should consider using bower to split your dev dependencies (handled by npm, non-deployed stuff) and front-end libs (handled by bower, deployed stuff).

Using a .bowerrc like this, you can tell where to save the libs in you projects structure:

{
  "directory": "./<your-public-folder>/libs"
}

Upvotes: 1

Related Questions