dsebastien/modernWebDevBuild

Disable mangleProductionJSBundle for Angular 2 Beta (1|2)

JanOschii opened this issue · 3 comments

Builded projects didn't run as long as the Javascript bundle is mangled.
angular/angular#6366
angular/angular#6380

Temporary workaround: Change Gulp options in gulpfile.babel.js by adding options.mangleProductionJSBundle = false;

"use strict";

import gulp from "gulp";

import modernWebDevBuild from "modern-web-dev-build";
let options = {};

//options.distEntryPoint = "core/core.bootstrap";

// Mangle JS Bundle didn't work with Angular 2 Beta 
// https://github.com/angular/angular/issues/6366
// https://github.com/angular/angular/issues/6380
options.mangleProductionJSBundle = false;

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

modernWebDevBuild.registerTasks(gulp, options);

I'm not sure I understand the issue here?
I've introduced the mangleProductionJSBundle option exactly for that. Because by default, I did mangle the production code but realized that Angular 2 didn't like it :)

I need a while to find out, that I have to disable the mangleProductionJSBundle option to get a running project with the angular 2 beta.

I believe there are some people that might struggle at the same point.
So I thought it would be a good idea, to include the line options.mangleProductionJSBundle = false;
in gulpfile.babel.js as long as angular didn't fixed this issue.

I pulled the modern-web-dev-generator repo and changed the template of the gulpfile.babel.js in a new branch. Can you give me the permission to push my updates and take a look on the changes?

The easiest is to fork the generator and create a pull request through GitHub. That allows for a nice code review process