Reputation: 63
I'm facing a problem others seem to have before me, but I don't find any solution to fix it. So this maybe a redundant topic but it might help me.
/* File: gulpfile.js */
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.styles([
'components.css',
'custom.css'
])
.version(['css/all.css']);
});
The gulp command works fine :
[13:58:34] Using gulpfile C:\laragon\www\SmartTeam\gulpfile.js
[13:58:34] Starting 'all'...
[13:58:34] Starting 'styles'...
[13:58:35] Finished 'styles' after 314 ms
[13:58:35] Starting 'version'...
[13:58:35] Finished 'version' after 87 ms
[13:58:35] Finished 'all' after 409 ms
[13:58:35] Starting 'default'...
┌───────────────┬──────────────────────────┬─────────────────────────────────────┬────────────────────┐
│ Task │ Summary │ Source Files │ Destination │
├───────────────┼──────────────────────────┼─────────────────────────────────────┼────────────────────┤
│ mix.styles() │ 1. Concatenating Files │ resources\assets\css\components.css │ public\css\all.css │
│ │ 2. Writing Source Maps │ resources\assets\css\custom.css │ │
│ │ 3. Saving to Destination │ │ │
├───────────────┼──────────────────────────┼─────────────────────────────────────┼────────────────────┤
│ mix.version() │ 1. Versioning │ public\css\all.css │ public\build │
│ │ 2. Rewriting File Paths │ │ │
│ │ 3. Saving to Destination │ │ │
│ │ 4. Copying Source Maps │ │ │
└───────────────┴──────────────────────────┴─────────────────────────────────────┴────────────────────┘
[13:58:35] Finished 'default' after 40 ms
After this, my public build folder contains all.css :
-public
--build
---css
----all-2f8e630ec5.css
----all.css.map
--rev.manifest.json
And in my view, I simply do :
<link type="text/css" rel="stylesheet" href="{{elixir('css/all.css')}}" />
What am I missing ?
Upvotes: 2
Views: 992
Reputation: 6646
Instead of elixir
use mix
:
<link type="text/css" rel="stylesheet" href="{{mix('css/all.css')}}" />
Upvotes: 2