0

I was trying to make "backend/frontend" separated folder structure for assets in my Laravel 5.1 project, using bower and custom less, css and js scrips. Currently my assets folder structure is next:

 * resources/assets/
 * --frontend/
 * ----css/
 * ----js/
 * ----less/
 * --backend/
 * ----css/
 * ----js/
 * ----less/
 * --vendor/

Public folder structure is:

 * ./public/
 * --frontend/
 * ----css/
 * ----js/
 * ----fonts/
 * --backend/
 * ----css/
 * ----js/
 * ----fonts/
 * --img/

I'm trying to compile "less" with "mix.less" but if i try to set path to frontend/backend less directory as a first parameter, elixir prepends that path with "resources/assets/less".

.less('./resources/assets/frontend/less/assets.less',
      publicDir + 'frontend/' + cssDir + 'assets.min.css',
       { paths: [
           vendorDir + "bootstrap/less",
           vendorDir + "font-awesome/less",
           vendorDir + "animate.less"
       ] })

The resultant nodejs error message for not finding specified file is:

File not found: resources/assets/less/resources/assets/frontend/less/assets.less

My question is:

How to specify path to ".less" file in compiler?

{!! Sorry for my bad English !!}

1 Answers1

0

--- Solution Founded ---

Before "elixir(function(mix) { ..." you should change less folder in elixir config by adding next code:

elixir.config.assetsDir = "./resources/assets/frontend/";

This will change assets directory to current task and allow to have multiple apps enviroments in the same project. Acording to this post.

Community
  • 1
  • 1