13 Star 27 Fork 5

phodal / weapp-webdemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gulpfile.js 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
phodal 提交于 2016-09-26 22:16 . add rpx code
var gulp = require('gulp'),
exec = require('child_process').exec;
gulp.task('watch', function() {
var watcher = gulp.watch('src/**/*.wxml');
watcher.on('change', function(event) {
var outputFileName = event.path.substring(0, event.path.length - 4) + 'js';
outputFileName = outputFileName.replace('/src/', '/build/');
var inputPath = event.path.replace(__dirname + '/', '');
exec('./vendor/wcc -d ' + inputPath + ' > ' + outputFileName, function(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
});
});
var wxssWatcher = gulp.watch('src/**/*.wxss');
wxssWatcher.on('change', function(event) {
var outputFileName = event.path.substring(0, event.path.length - 4) + 'css';
outputFileName = outputFileName.replace('/src/', '/build/');
var inputPath = event.path.replace(__dirname + '/', '');
exec('./vendor/wcsc -d ' + inputPath + ' > ' + outputFileName, function(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
});
});
});
微信
1
https://gitee.com/phodal/weapp-webdemo.git
git@gitee.com:phodal/weapp-webdemo.git
phodal
weapp-webdemo
weapp-webdemo
master

搜索帮助