You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: elixir.md
+37-37
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ To compile [Less](http://lesscss.org/) into CSS, you may use the `less` method.
87
87
88
88
```javascript
89
89
elixir(function(mix) {
90
-
mix.less("app.less");
90
+
mix.less('app.less');
91
91
});
92
92
```
93
93
@@ -96,9 +96,9 @@ You may also combine multiple Less files into a single CSS file. Again, the resu
96
96
```javascript
97
97
elixir(function(mix) {
98
98
mix.less([
99
-
"app.less",
100
-
"controllers.less"
101
-
], "public/assets/css");
99
+
'app.less',
100
+
'controllers.less'
101
+
], 'public/assets/css');
102
102
});
103
103
```
104
104
@@ -122,7 +122,7 @@ The `sass` method allows you to compile [Sass](http://sass-lang.com/) into CSS.
122
122
123
123
```javascript
124
124
elixir(function(mix) {
125
-
mix.sass("app.scss");
125
+
mix.sass('app.scss');
126
126
});
127
127
```
128
128
@@ -131,9 +131,9 @@ Again, like the `less` method, you may compile multiple scripts into a single CS
131
131
```javascript
132
132
elixir(function(mix) {
133
133
mix.sass([
134
-
"app.scss",
135
-
"controllers.scss"
136
-
], "public/assets/css");
134
+
'app.scss',
135
+
'controllers.scss'
136
+
], 'public/assets/css');
137
137
});
138
138
```
139
139
@@ -143,7 +143,7 @@ Under the hood, Elixir uses the LibSass library for compilation. In some instanc
143
143
144
144
```javascript
145
145
elixir(function(mix) {
146
-
mix.rubySass("app.scss");
146
+
mix.rubySass('app.scss');
147
147
});
148
148
```
149
149
@@ -155,8 +155,8 @@ If you would just like to combine some plain CSS stylesheets into a single file,
155
155
```javascript
156
156
elixir(function(mix) {
157
157
mix.styles([
158
-
"normalize.css",
159
-
"main.css"
158
+
'normalize.css',
159
+
'main.css'
160
160
]);
161
161
});
162
162
```
@@ -166,9 +166,9 @@ Of course, you may also output the resulting file to a custom location by passin
166
166
```javascript
167
167
elixir(function(mix) {
168
168
mix.styles([
169
-
"normalize.css",
170
-
"main.css"
171
-
], "public/assets/css");
169
+
'normalize.css',
170
+
'main.css'
171
+
], 'public/assets/css');
172
172
});
173
173
```
174
174
@@ -183,7 +183,7 @@ If you do not want source maps generated for your CSS, you may disable them usin
183
183
elixir.config.sourcemaps=false;
184
184
185
185
elixir(function(mix) {
186
-
mix.sass("app.scss");
186
+
mix.sass('app.scss');
187
187
});
188
188
```
189
189
@@ -224,8 +224,8 @@ The `babel` method may be used to compile [EcmaScript 6 and 7](https://babeljs.i
224
224
```javascript
225
225
elixir(function(mix) {
226
226
mix.babel([
227
-
"order.js",
228
-
"product.js"
227
+
'order.js',
228
+
'product.js'
229
229
]);
230
230
});
231
231
```
@@ -243,8 +243,8 @@ The `scripts` method assumes all paths are relative to the `resources/assets/js`
243
243
```javascript
244
244
elixir(function(mix) {
245
245
mix.scripts([
246
-
"jquery.js",
247
-
"app.js"
246
+
'jquery.js',
247
+
'app.js'
248
248
]);
249
249
});
250
250
```
@@ -262,7 +262,7 @@ If you need to combine all of the scripts in a given directory, you may use the
262
262
263
263
```javascript
264
264
elixir(function(mix) {
265
-
mix.scriptsIn("public/js/some/directory");
265
+
mix.scriptsIn('public/js/some/directory');
266
266
});
267
267
```
268
268
@@ -275,7 +275,7 @@ The `version` method accepts a file name relative to the `public` directory, and
275
275
276
276
```javascript
277
277
elixir(function(mix) {
278
-
mix.version("css/all.css");
278
+
mix.version('css/all.css');
279
279
});
280
280
```
281
281
@@ -289,7 +289,7 @@ You may pass an array to the `version` method to version multiple files:
289
289
290
290
```javascript
291
291
elixir(function(mix) {
292
-
mix.version(["css/all.css", "js/app.js"]);
292
+
mix.version(['css/all.css', 'js/app.js']);
293
293
});
294
294
```
295
295
@@ -305,10 +305,10 @@ Once the files have been versioned, you may use the `elixir` helper function to
305
305
If you need to call an existing Gulp task from Elixir, you may use the `task` method. As an example, imagine that you have a Gulp task that simply speaks a bit of text when called:
306
306
307
307
```javascript
308
-
gulp.task("speak", function() {
309
-
var message ="Tea...Earl Grey...Hot";
308
+
gulp.task('speak', function() {
309
+
var message ='Tea...Earl Grey...Hot';
310
310
311
-
gulp.src("").pipe(shell("say "+ message));
311
+
gulp.src('').pipe(shell('say '+ message));
312
312
});
313
313
```
314
314
@@ -338,17 +338,17 @@ If you need more flexibility than Elixir's `task` method can provide, you may cr
338
338
```javascript
339
339
// File: elixir-extensions.js
340
340
341
-
var gulp =require("gulp");
342
-
var shell =require("gulp-shell");
343
-
var elixir =require("laravel-elixir");
341
+
var gulp =require('gulp');
342
+
var shell =require('gulp-shell');
343
+
var elixir =require('laravel-elixir');
344
344
345
-
elixir.extend("speak", function(message) {
345
+
elixir.extend('speak', function(message) {
346
346
347
-
gulp.task("speak", function() {
348
-
gulp.src("").pipe(shell("say "+ message));
347
+
gulp.task('speak', function() {
348
+
gulp.src('').pipe(shell('say '+ message));
349
349
});
350
350
351
-
returnthis.queueTask("speak");
351
+
returnthis.queueTask('speak');
352
352
353
353
});
354
354
```
@@ -358,12 +358,12 @@ That's it! You may either place this at the top of your Gulpfile, or instead ext
358
358
```javascript
359
359
// File: Gulpfile.js
360
360
361
-
var elixir =require("laravel-elixir");
361
+
var elixir =require('laravel-elixir');
362
362
363
-
require("./elixir-extensions")
363
+
require('./elixir-extensions')
364
364
365
365
elixir(function(mix) {
366
-
mix.speak("Tea, Earl Grey, Hot");
366
+
mix.speak('Tea, Earl Grey, Hot');
367
367
});
368
368
```
369
369
@@ -372,7 +372,7 @@ elixir(function(mix) {
372
372
If you would like your custom task to be re-triggered while running `gulp watch`, you may register a watcher:
0 commit comments