gulpfile.js 备份
来源:互联网 发布:杀牛电击锤价格淘宝 编辑:程序博客网 时间:2024/06/06 02:42
'use strict';
var gulp =require('gulp'),
uglifycss = require('gulp-uglifycss'),
htmlmin = require('gulp-htmlmin'),
embedSass = require('gulp-angular2-embed-sass'),
embedTemplates = require('gulp-angular-embed-templates');
gulp.task('copy-scss',function() {
gulp.src([
'src/app/**/*.css',
'src/app/**/*.scss'
])
.pipe(uglifycss({"uglyComments":true}))
.pipe(gulp.dest('release'));
});
gulp.task('copy-html',function () {
var options = {
removeComments: true, //清除HTML注释
collapseWhitespace: true, //压缩HTML
collapseBooleanAttributes: true, //省略布尔属性的值 <input checked="true"/> ==> <input checked />
removeEmptyAttributes: true, //删除所有空格作属性值 <input id="" /> ==> <input />
removeScriptTypeAttributes: true, //删除<script>的type="text/javascript"
removeStyleLinkTypeAttributes: true, //删除<style>和<link>的type="text/css"
minifyJS: true,//压缩页面JS
minifyCSS: true//压缩页面CSS
};
gulp.src('src/app/**/*.html')
.pipe(htmlmin(options))
.pipe(gulp.dest('release'));
});
gulp.task('embedTemplatesSass',function() {
gulp.src('src/app/**/*')
// Angular1Processor.js 这个文件39行new html.DomHandler(this.minimizer.emits('read')), this.config.minimize.dom || {lowerCaseAttributeNames: false, lowerCaseTags: false}
.pipe(embedTemplates({sourceType:'ts',minimize: {dom: {lowerCaseAttributeNames:false, lowerCaseTags:false}}}))
.pipe(embedSass())
.pipe(gulp.dest('temp'));
});
//Building project with run sequence
// gulp.task('default', ['copy-scss', 'copy-html']);
gulp.task('default', ['embedTemplatesSass'],function() {
// console.log('finished.');
});
阅读全文
0 0
- gulpfile.js 备份
- 我的gulpfile.js
- 简单gulpfile.js写法
- 基本gulpfile.js
- gulp配置文件gulpfile.js
- gulpfile.js的配置
- gulpfile.js文件内容
- Gulpfile.js 详解
- gulpfile.js常用配置文件
- 项目使用的gulpfile.js
- 前端 | 重构 gulpfile.js
- gulpfile
- 自动化构建工具Gulp配置文件gulpfile.js
- Gulp的配置文件gulpfile.babel.js
- 关于gulpfile.js和package.json
- gulp的gulpfile.js文件配置
- gulpfile.js文件创建与配置
- 包含常用功能的 gulpfile.js
- effevtive java--消除过期对象的引用
- Linux 给用户及用户组分配权限以及对文件目录的操作
- RSA加解密的应用
- C++中不能声明为虚函数的有哪些函数
- CentOS_7 Systemd 入门教程:实战篇
- gulpfile.js 备份
- 算法与数据结构实验题 2.3 泡泡的饭碗
- Macaca自动化测试框架
- 【头条】从超融合市场的探索与创新 看浪潮全面云化时代关键词
- 使用vue-Router2 实现路由功能
- java(十七):concurrent(2)—lock和condition
- 手把手教你在win2003_IIS6.0环境下配置主机头发布多个站点
- react-navigation使用技巧
- ffmpeg中遇到UINT64_C’ was not declared in this scope