How to choose the default folder when performing the "Styles" and "scripts" functions of Elixir?

Asked

Viewed 67 times

0

Using the Laravel Elixir, I usually use the functions styles and scripts to concatenate the Assets to a single file. However, it seems that by default these two functions try to read files from the folder resources/assets.

Whenever I need to perform these operations in the folder node_modules, i need to put "two-points" in the file path, which makes the task get quite boring.

My file gulpfile.js is like this:

elixir(function (mix) {

    mix.styles([
        '../../../node_modules/admin-lte/dist/css/AdminLTE.css',
        '../../../node_modules/admin-lte/dist/css/skins/_all-skins.css',
        '../../../node_modules/ionicons/dist/css/ionicons.css'
    ], 'public/css/_compiled.css');
});

Is there any way to set the default read folder of these file, for me to avoid repetition of ../../../node_modules/?

  • 1

    elixir.config.assetsDir = 'node_modules/js/';

  • Cool, I think that solves it too. It would be interesting if it had how to make a default folder definition by calling styles or scripts.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.