-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(html-minify): ignore interpolation expressions
also introduces better error handling for the processMarkup task closes #619
- Loading branch information
1 parent
9bfe9bc
commit 803c904
Showing
4 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
import gulp from 'gulp'; | ||
import htmlmin from 'gulp-htmlmin'; | ||
import plumber from 'gulp-plumber'; | ||
import notify from 'gulp-notify'; | ||
import changedInPlace from 'gulp-changed-in-place'; | ||
import project from '../aurelia.json'; | ||
import {build} from 'aurelia-cli'; | ||
|
||
export default function processMarkup() { | ||
return gulp.src(project.markupProcessor.source) | ||
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) | ||
.pipe(changedInPlace({firstPass:true})) | ||
.pipe(htmlmin({ | ||
removeComments: true, | ||
collapseWhitespace: true, | ||
minifyCSS: true, | ||
minifyJS: true | ||
minifyJS: true, | ||
ignoreCustomFragments: [/\${.*}/g] // ignore interpolation expressions | ||
})) | ||
.pipe(build.bundle()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
import * as gulp from 'gulp'; | ||
import * as htmlmin from 'gulp-htmlmin'; | ||
import * as plumber from 'gulp-plumber'; | ||
import * as notify from 'gulp-notify'; | ||
import * as changedInPlace from 'gulp-changed-in-place'; | ||
import * as project from '../aurelia.json'; | ||
import {build} from 'aurelia-cli'; | ||
|
||
export default function processMarkup() { | ||
return gulp.src(project.markupProcessor.source) | ||
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) | ||
.pipe(changedInPlace({firstPass:true})) | ||
.pipe(htmlmin({ | ||
removeComments: true, | ||
collapseWhitespace: true, | ||
minifyCSS: true, | ||
minifyJS: true | ||
minifyJS: true, | ||
ignoreCustomFragments: [/\${.*}/g] // ignore interpolation expressions | ||
})) | ||
.pipe(build.bundle()); | ||
} |