Skip to content

Instantly share code, notes, and snippets.

@ptflp
Last active June 19, 2018 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptflp/0d5ec0145eba4c23cdb9ceef103789f0 to your computer and use it in GitHub Desktop.
Save ptflp/0d5ec0145eba4c23cdb9ceef103789f0 to your computer and use it in GitHub Desktop.
Yii2 gulp 4 file reference
docker-compose up -d
var
gulp = require("gulp"),
browserSync = require('browser-sync').create(),
childProcess = require('child_process');
gulp.task('docker-start', function (callback) {
console.log("---------Start--------------------------");
return childProcess.exec('Powershell.exe -executionpolicy remotesigned -File docker.ps1', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
if (err) console.log(err);
console.log("Finished");
});
});
gulp.task('watch', function () {
gulp.watch("./**/*.php").on('change', gulp.parallel(browserSync.reload));
});
gulp.task('ws', function() {
browserSync.init({
proxy: "localhost:8000",
notify: false,
snippetOptions: {
rule: {
match: /$/
}
}
});
});
gulp.task('init', gulp.series('docker-start','ws'));
gulp.task("default",gulp.parallel('watch','docker-start','ws'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment