Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

HTML minification breaks Angular 2 #67

Open
dsebastien opened this issue Dec 20, 2015 · 6 comments
Open

HTML minification breaks Angular 2 #67

dsebastien opened this issue Dec 20, 2015 · 6 comments
Labels

Comments

@dsebastien
Copy link
Owner

Angular 2 does not seem to like:

ngFor vs ngfor
routerLink vs routerlink
<blockquote cite="http://www.google.be">...</blockquote> vs <blockquote cite=http://www.google.be>...</blockquote>

These are modifications that https://www.npmjs.com/package/gulp-minify-html does by default via https://github.com/Swaagie/minimize.
The behavior with quotes can be changed but not that with case sensitivity

@dsebastien
Copy link
Owner Author

This is known: angular/angular#5789

@dsebastien
Copy link
Owner Author

Apparently the solution proposed by the Angular team will be an offline template compiler, meaning that we'll have to branch depending on whether the client project uses Angular or not

@dsebastien
Copy link
Owner Author

Issue to keep an eye on: Swaagie/minimize#74

@dsebastien
Copy link
Owner Author

For now, a workaround is to use the new option to disable HTML minification.

gulpfile.babel.js:

options.minifyProductionHTML = false; // HTML minification is not supported by Angular 2 anymore: https://github.com/dsebastien/modernWebDevBuild/issues/67

@yizhan
Copy link

yizhan commented Jan 12, 2016

I had same problem with minify Angular2.
It seem has been fix when bump minimize version from 1.7.4 to 1.7.5 (now is 1.8.1?) and added the "dom" option.

dom: {
    lowerCaseAttributeNames: false
}

@dsebastien
Copy link
Owner Author

Thanks for the tip @yizhan I'll try this out!

@dsebastien dsebastien modified the milestones: 0.4.0, 0.3.1 Jan 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants