Skip to content

Commit a4a9798

Browse files
author
Shuwen Qian
committed
Bump gulp-vulcanize and fix excludes
1 parent ccf6d27 commit a4a9798

2 files changed

Lines changed: 30 additions & 13 deletions

File tree

Gulpfile.js

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ gulp.task('patch-lib', function() {
5757
});
5858

5959
gulp.task('clean', function() {
60-
return del([BUILD + '**', BUILD_DOCS+ '**', DIST+ '**']);
60+
return del([BUILD + '**', BUILD_DOCS+ '**']);
6161
});
6262

6363
gulp.task('copy', function() {
@@ -95,25 +95,22 @@ gulp.task('font', function() {
9595

9696
gulp.task('vulcanize', function() {
9797
var modules = gulp.src(BUILD + "mm-*/mm-*.html")
98-
.pipe(changed(BUILD))
98+
.pipe(debug())
9999
.pipe(vulcanize({
100-
inlineScripts:true,
101-
inlineCss:true,
102-
stripExcludes:true,
103-
excludes: {
104-
imports: ['.*polymer\.html']
105-
}
100+
inlineScripts: true,
101+
inlineCss: true,
102+
excludes: ['bower_components/polymer/polymer.html']
106103
}))
104+
.pipe(debug())
107105
.pipe(htmlmin())
108106
.pipe(gulp.dest(BUILD));
107+
109108
var lib = gulp.src(BUILD + "strand.html")
110109
.pipe(vulcanize({
111110
inlineScripts:true,
112111
inlineCss:true,
113112
stripExcludes:false,
114-
// excludes: {
115-
// imports: ['.*\.html','polymer.html']
116-
// }
113+
excludes: ['bower_components/polymer/polymer.html']
117114
}))
118115
.pipe(gulp.dest(BUILD));
119116
return merge(modules, lib);
@@ -127,8 +124,28 @@ gulp.task('build', function(cb) {
127124
run('copy',['sass','font'],'vulcanize',cb);
128125
});
129126

127+
gulp.task('build:modules', function() {
128+
var modules = gulp.src(BUILD + 'strand.html')
129+
.pipe(vulcanize({
130+
inlineScripts:true,
131+
inlineCss:true,
132+
stripExcludes:false
133+
}))
134+
.pipe(base64(['.woff']))
135+
.pipe(htmlmin({
136+
quotes: true,
137+
empty: true,
138+
spare: true
139+
}))
140+
.pipe(inlinemin())
141+
.pipe(header('<!--\n' + fs.readFileSync('BANNER.txt').toString('utf8') + ' -->'))
142+
.pipe(changed(DIST))
143+
.pipe(gulp.dest(DIST));
144+
return modules;
145+
});
146+
130147
gulp.task('build:prod', ['patch-lib', 'build'], function() {
131-
return gulp.src(BUILD + 'strand.html')
148+
var lib = gulp.src(BUILD + 'strand.html')
132149
.pipe(vulcanize({
133150
inlineScripts:true,
134151
inlineCss:true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"gulp-sass": "^2.1.0",
3838
"gulp-tag-version": "^1.3.0",
3939
"gulp-util": "^3.0.7",
40-
"gulp-vulcanize": "^6.0.1",
40+
"gulp-vulcanize": "^6.1.0",
4141
"gulp-wrap": "^0.11.0",
4242
"hogan.js": "^3.0.2",
4343
"marked": "^0.3.3",

0 commit comments

Comments
 (0)