質問編集履歴
1
app\.cssが生成されません
test
CHANGED
File without changes
|
test
CHANGED
@@ -219,3 +219,201 @@
|
|
219
219
|
.pipe(postcss())
|
220
220
|
|
221
221
|
.pipe(cssnext())
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
・その後下記のように変更して、gulpwatchは問題なく動いているのですがapp.cssが生成されません。
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
```ここに言語を入力
|
234
|
+
|
235
|
+
var gulp = require('gulp');
|
236
|
+
|
237
|
+
var plumber = require('gulp-plumber');
|
238
|
+
|
239
|
+
var postcssimport = require('postcss-import');
|
240
|
+
|
241
|
+
var postcss = require('gulp-postcss'); //gulp-postcssをインポート
|
242
|
+
|
243
|
+
var cssnext = require('postcss-cssnext'); //cssnextをインポート
|
244
|
+
|
245
|
+
var rename = require('gulp-rename');
|
246
|
+
|
247
|
+
var csslint = require('gulp-csslint');
|
248
|
+
|
249
|
+
var autoPrefixer = require('gulp-autoprefixer');
|
250
|
+
|
251
|
+
//if node version is lower than v.0.1.2
|
252
|
+
|
253
|
+
require('es6-promise').polyfill();
|
254
|
+
|
255
|
+
var cssComb = require('gulp-csscomb');
|
256
|
+
|
257
|
+
var cmq = require('gulp-merge-media-queries');
|
258
|
+
|
259
|
+
var cleanCss = require('gulp-clean-css');
|
260
|
+
|
261
|
+
gulp.task('css',function(){
|
262
|
+
|
263
|
+
gulp.src(['dest-recycling-corpolate/css/*.css'])
|
264
|
+
|
265
|
+
.pipe(plumber({
|
266
|
+
|
267
|
+
handleError: function (err) {
|
268
|
+
|
269
|
+
console.log(err);
|
270
|
+
|
271
|
+
this.emit('end');
|
272
|
+
|
273
|
+
}
|
274
|
+
|
275
|
+
}))
|
276
|
+
|
277
|
+
.pipe(postcss([
|
278
|
+
|
279
|
+
postcssimport(),
|
280
|
+
|
281
|
+
cssnext()
|
282
|
+
|
283
|
+
]))
|
284
|
+
|
285
|
+
.pipe(autoPrefixer())
|
286
|
+
|
287
|
+
.pipe(cssComb())
|
288
|
+
|
289
|
+
.pipe(cmq({log:true}))
|
290
|
+
|
291
|
+
.pipe(csslint())
|
292
|
+
|
293
|
+
.pipe(csslint.reporter())
|
294
|
+
|
295
|
+
.pipe(gulp.dest('dest-recycling-corpolate/css'))
|
296
|
+
|
297
|
+
.pipe(rename({
|
298
|
+
|
299
|
+
suffix: '.min'
|
300
|
+
|
301
|
+
}))
|
302
|
+
|
303
|
+
.pipe(cleanCss())
|
304
|
+
|
305
|
+
.pipe(gulp.dest('dest-recycling-corpolate/css'))
|
306
|
+
|
307
|
+
});
|
308
|
+
|
309
|
+
gulp.task('js',function(){
|
310
|
+
|
311
|
+
gulp.src(['js/src/**/*.js'])
|
312
|
+
|
313
|
+
.pipe(plumber({
|
314
|
+
|
315
|
+
handleError: function (err) {
|
316
|
+
|
317
|
+
console.log(err);
|
318
|
+
|
319
|
+
this.emit('end');
|
320
|
+
|
321
|
+
}
|
322
|
+
|
323
|
+
}))
|
324
|
+
|
325
|
+
.pipe(gulp.dest('js/dist'))
|
326
|
+
|
327
|
+
});
|
328
|
+
|
329
|
+
gulp.task('html',function(){
|
330
|
+
|
331
|
+
gulp.src(['html/**/*.html'])
|
332
|
+
|
333
|
+
.pipe(plumber({
|
334
|
+
|
335
|
+
handleError: function (err) {
|
336
|
+
|
337
|
+
console.log(err);
|
338
|
+
|
339
|
+
this.emit('end');
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
}))
|
344
|
+
|
345
|
+
.pipe(gulp.dest('./'))
|
346
|
+
|
347
|
+
});
|
348
|
+
|
349
|
+
//以下gulp-watch
|
350
|
+
|
351
|
+
gulp.task('watch', function(){
|
352
|
+
|
353
|
+
gulp.watch(['src-recycling-corpolate/*' , 'src-recycling-corpolate/*/*' , 'src-recycling-corpolate/*/*/*'], ['css']);//監視したいファイルの相対パス
|
354
|
+
|
355
|
+
});
|
356
|
+
|
357
|
+
```
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
・下記が環境です。
|
368
|
+
|
369
|
+
C:.
|
370
|
+
|
371
|
+
├─dest-recycling-corpolate
|
372
|
+
|
373
|
+
│ ├─css
|
374
|
+
|
375
|
+
│ │ ├─foundation
|
376
|
+
|
377
|
+
│ │ ├─layout
|
378
|
+
|
379
|
+
│ │ └─object
|
380
|
+
|
381
|
+
│ │ ├─component
|
382
|
+
|
383
|
+
│ │ ├─project
|
384
|
+
|
385
|
+
│ │ └─utility
|
386
|
+
|
387
|
+
│ ├─html
|
388
|
+
|
389
|
+
│ ├─img
|
390
|
+
|
391
|
+
│ │ ├─common-img
|
392
|
+
|
393
|
+
│ │ └─index
|
394
|
+
|
395
|
+
│ ├─plugin
|
396
|
+
|
397
|
+
│ └─web-font
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
下記はgulp.jsをカレントディレクトリとして相対パスを指定すればいいのですよね。
|
404
|
+
|
405
|
+
gulp.src(['html/**/*.html'])これはまだ書き直していない
|
406
|
+
|
407
|
+
.pipe(gulp.dest('dest-recycling-corpolate/css'))
|
408
|
+
|
409
|
+
gulp.src(['dest-recycling-corpolate/css/*.css'])
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
・最後にVinylオブジェクトを返すものと返さないもので記述の仕方を変えないといけないようですが、どう区別するのでしょうか。
|
418
|
+
|
419
|
+
そこまで来ると正直よくわかりません。
|