質問編集履歴
1
試したソースを追記 エラー内容も追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -91,3 +91,101 @@
|
|
91
91
|
### 色々と調べましたが、どうもうまくいかない。。
|
92
92
|
|
93
93
|
どなたかこの後、こう記述すれば実現できるといった事をアドバイス頂けると幸いです。
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
### 追記
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
以下のように修正してみましたが、
|
104
|
+
|
105
|
+
エラーがでてしまいます。
|
106
|
+
|
107
|
+
```js
|
108
|
+
|
109
|
+
var browserSync = require("browser-sync");
|
110
|
+
|
111
|
+
var gulp = require('gulp');
|
112
|
+
|
113
|
+
var sass = require('gulp-sass');
|
114
|
+
|
115
|
+
var sassGlob = require('gulp-sass-glob');
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
gulp.task('sass', function(){
|
120
|
+
|
121
|
+
gulp.src('./src/scss/**/*')
|
122
|
+
|
123
|
+
.pipe(sassGlob())
|
124
|
+
|
125
|
+
.pipe(sass({
|
126
|
+
|
127
|
+
// コンパイル時の整形
|
128
|
+
|
129
|
+
outputStyle: 'expanded'
|
130
|
+
|
131
|
+
}))
|
132
|
+
|
133
|
+
.on('error', sass.logError)
|
134
|
+
|
135
|
+
.pipe(gulp.dest('./'));
|
136
|
+
|
137
|
+
});
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
gulp.task('browserSync', function () {
|
142
|
+
|
143
|
+
browserSync({
|
144
|
+
|
145
|
+
proxy: "10.0.0.xxx:8000/abc",
|
146
|
+
|
147
|
+
files: [
|
148
|
+
|
149
|
+
"./style.css",
|
150
|
+
|
151
|
+
"./**/*.php",
|
152
|
+
|
153
|
+
]
|
154
|
+
|
155
|
+
});
|
156
|
+
|
157
|
+
});
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
gulp.task('watch', function(){
|
162
|
+
|
163
|
+
gulp.watch('./src/scss/**/*.scss', ['sass']);
|
164
|
+
|
165
|
+
});
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
gulp.task('default', ['browserSync', 'sass', 'watch']);
|
170
|
+
|
171
|
+
```
|
172
|
+
|
173
|
+
### エラー内容
|
174
|
+
|
175
|
+
```ここに言語を入力
|
176
|
+
|
177
|
+
/Users/abc/wp-content/themes/xxx-child/node_modules/gulp-sass-glob/dist/index.js:69
|
178
|
+
|
179
|
+
var contents = file.contents.toString('utf-8');
|
180
|
+
|
181
|
+
^
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
TypeError: Cannot read property 'toString' of null
|
186
|
+
|
187
|
+
at transform (/Users/abc/wp-content/themes/xxx-child/node_modules/gulp-sass-glob/dist/index.js:69:32)
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
```
|