Answer the question
In order to leave comments, you need to log in
Building php files in Gulp --- TypeError: Cannot read property 'php' of undefined?
TypeError: Cannot read property 'php' of undefined
This error is displayed in the console when trying to build php files from one folder to another.
No actions are taken on the files, a normal ejection.
Path to files:
const path = {
src: {
_lcss: 'src/libs/*.css',
_ljs: 'src/libs/*.js',
js: 'src/js/*.js',
phpsc: 'src/php/*.php',
scss: 'src/sass/style.scss',
img: 'src/img/*.*',
svg: 'src/svg/*.svg',
fonts: 'src/fonts/**/*.*',
deploy: 'dist/**/*'
},
dist: {
css: 'dist/css/',
js: 'dist/js/',
phpsc: 'dist/',
img: 'dist/images/',
fonts: 'dist/fonts/',
scss: 'dist/'
},
watch: {
js: 'src/js/*.js',
phpsc: 'src/php/*.php',
scss: 'src/sass/style.scss'
},
clear: 'dist'
};
gulp.task('php:build', () => {
return gulp.src(path.src.phpsc)
.pipe(gulp.dest(path.dest.phpsc))
});
$ gulp php:build
[23:51:07] Using gulpfile F:\Workspace\Builder\startps\builder\gulpfile.js
[23:51:07] Starting 'php:build'...
[23:51:07] 'php:build' errored after 7.15 ms
[23:51:07] TypeError: Cannot read property 'phpsc' of undefined
at Gulp.gulp.task (F:\Workspace\Builder\startps\builder\gulpfile.js:80:34)
at module.exports (F:\Workspace\Builder\startps\builder\node_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (F:\Workspace\Builder\startps\builder\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (F:\Workspace\Builder\startps\builder\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (F:\Workspace\Builder\startps\builder\node_modules\orchestrator\index.js:134:8)
at C:\Users\tonni\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:393:7)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question