質問編集履歴

1

訂正

2018/01/18 02:24

投稿

MeB
MeB

スコア104

test CHANGED
File without changes
test CHANGED
@@ -8,8 +8,114 @@
8
8
 
9
9
  > TypeError: Cannot read property 'split' of undefined
10
10
 
11
+
12
+
11
13
  とエラーがでてコンパイルができないのですが、
12
14
 
13
15
  調べても原因が全くわからず・・・
14
16
 
15
17
  ご教示よろしくお願い致します。
18
+
19
+
20
+
21
+ package.json
22
+
23
+ ```ここに言語を入力
24
+
25
+ {
26
+
27
+ "name": "test",
28
+
29
+ "version": "1.0.0",
30
+
31
+ "devDependencies": {
32
+
33
+ "gulp": "^3.9.1",
34
+
35
+ "gulp-autoprefixer": "^4.1.0",
36
+
37
+ "gulp-compass": "^2.1.0",
38
+
39
+ "gulp-concat": "^2.6.1",
40
+
41
+ "gulp-consolidate": "^0.1.2",
42
+
43
+ "gulp-iconfont": "^8.0.1",
44
+
45
+ "gulp-plumber": "^1.2.0",
46
+
47
+ "gulp-rename": "^1.2.2",
48
+
49
+ "gulp-sass": "^3.1.0",
50
+
51
+ "gulp-uglify": "^1.5.4",
52
+
53
+ "lodash": "^4.17.2"
54
+
55
+ }
56
+
57
+ }
58
+
59
+ ```
60
+
61
+ gulpfile.js
62
+
63
+ ```ここに言語を入力
64
+
65
+ gulp.task('sass', function(){
66
+
67
+ var path = event_obj.path;
68
+
69
+ if(path.indexOf('\') >= 0) {
70
+
71
+ path = path.split('www.test.com\')[1];
72
+
73
+ dir = path.split('scss\')[0];
74
+
75
+ } else {
76
+
77
+ path = path.split('www.test.com/')[1];
78
+
79
+ dir = path.split('scss/')[0];
80
+
81
+ }
82
+
83
+ gulp.src('htdocs/assets/scss/**/*.scss')
84
+
85
+ .pipe(plumber())
86
+
87
+ .pipe(sass({
88
+
89
+ outputStyle: 'compressed',
90
+
91
+ // outputStyle: 'expand',
92
+
93
+ // css: dir + '/css/',
94
+
95
+ // image: dir + '/images',
96
+
97
+ // sass: dir + '/scss/'
98
+
99
+ }))
100
+
101
+ .pipe(gulp.dest(dir + '/css/'));;
102
+
103
+ });
104
+
105
+ gulp.task('watch', function(){
106
+
107
+
108
+
109
+ // scssファイルを監視し、sassコンパイルを実行
110
+
111
+
112
+
113
+ gulp.watch('htdocs/common/scss/**/*.scss', ['sass_legacy'])
114
+
115
+ .on('change', function(event) {
116
+
117
+ event_obj = event;
118
+
119
+ });
120
+
121
+ ```