Skip to content

Commit 186d487

Browse files
committed
Change minification to remove mangling. v 2.0.3
1 parent 17bc67a commit 186d487

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Changelog
44

5+
## [2.0.3] - 2018-07-30
6+
### Fixed
7+
- The JS minification settings were too aggressive and would break some banners. It's been ratched down to not manage variable names.
8+
- The default "script.js" file has also changed the function style from named functions to function declarations.
9+
510
## [2.0.2] - 2018-07-30
611
### Fixed
712
- Some dependencies were listed in "devDependencies" which meant they did not install from the production version of BAB. They've been moved to the correct spot in the package.json file.

generators/app/templates/_gulpfile.babel.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ const nowDate = new Date();
5252

5353
const bannerMessageHtml = ['<!--',
5454
' <%- openTag %> pkg.name <%- closeTag %> - <%- openTag %> pkg.description <%- closeTag %>',
55-
' * Build A Banner info: https://www.npmjs.com/package/generator-buildabanner',
5655
' @version v<%- openTag %> pkg.version <%- closeTag %>',
5756
' @date ' + (nowDate.getMonth() + 1) + "-" + nowDate.getDate() + "-" + nowDate.getFullYear() + " at " + nowDate.getHours() + ":" + nowDate.getMinutes() + ":" + nowDate.getSeconds(),
57+
' * Build A Banner info: https://www.npmjs.com/package/generator-buildabanner',
5858
' -->',
5959
' ',
6060
''
6161
].join('\n');
6262

6363
const bannerMessageJsCss = ['/**',
6464
' * <%- openTag %> pkg.name <%- closeTag %> - <%- openTag %> pkg.description <%- closeTag %>',
65-
' * Build A Banner info: https://www.npmjs.com/package/generator-buildabanner',
6665
' * @version v<%- openTag %> pkg.version <%- closeTag %>',
6766
' * @date ' + (nowDate.getMonth() + 1) + "-" + nowDate.getDate() + "-" + nowDate.getFullYear() + " at " + nowDate.getHours() + ":" + nowDate.getMinutes() + ":" + nowDate.getSeconds(),
67+
' * Build A Banner info: https://www.npmjs.com/package/generator-buildabanner',
6868
' */',
6969
' ',
7070
''
@@ -94,14 +94,9 @@ function scripts() {
9494
.pipe(uglify({
9595
compress: {
9696
// compress options
97-
drop_console: beautify
98-
},
99-
mangle: {
100-
// mangle options
101-
properties: {
102-
// mangle property options
103-
}
97+
drop_console: true
10498
},
99+
mangle: false,
105100
output: {
106101
beautify: beautify
107102
}

generators/app/templates/dev/_script_adwords.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var removeMeBABExample;
66

77
//Function to run with any animations starting on load, or bringing in images etc
8-
bannerInit = function(){
8+
function bannerInit(){
99
// adds class "loaded" to the body
1010
// document.getElementsByTagName('body')[0].className+=' loaded';
1111

@@ -20,7 +20,7 @@ bannerInit = function(){
2020
anim();
2121
}
2222

23-
anim = function(){
23+
function anim(){
2424
console.log('animating');
2525

2626
// Example #1

generators/app/templates/dev/_script_dc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var bgExit;
99
var removeMeBABExample;
1010

1111
//Function to run with any animations starting on load, or bringing in images etc
12-
bannerInit = function(){
12+
function bannerInit{
1313
// adds class "loaded" to the body
1414
// document.getElementsByTagName('body')[0].className+=' loaded';
1515

@@ -35,7 +35,7 @@ bannerInit = function(){
3535
anim();
3636
}
3737

38-
anim = function(){
38+
function anim(){
3939
console.log('Banner animation has begun.');
4040

4141
// Example #1
@@ -52,11 +52,11 @@ anim = function(){
5252
}
5353

5454
//Add Event Listeners for DoubleClick
55-
addListeners = function() {
55+
function addListeners() {
5656
bgExit.addEventListener('click', bgExitHandler, false);
5757
}
5858

59-
bgExitHandler = function(e) {
59+
function bgExitHandler(e) {
6060
//Call Exits
6161
Enabler.exit('HTML5_Background_Clickthrough');
6262
}

generators/app/templates/dev/_script_sizmek.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
var removeMeBABExample;
1010

1111
//Function to run with any animations starting on load, or bringing in images etc
12-
bannerInit = function(){
12+
function bannerInit(){
1313
// adds class "loaded" to the body
1414
// document.getElementsByTagName('body')[0].className+=' loaded';
1515

@@ -27,7 +27,7 @@ bannerInit = function(){
2727
anim();
2828
}
2929

30-
anim = function(){
30+
function anim(){
3131
console.log('animating');
3232

3333
// Example #1

generators/app/templates/dev/_script_standard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
var removeMeBABExample;
1010

1111
//Function to run with any animations starting on load, or bringing in images etc
12-
bannerInit = function(){
12+
function bannerInit(){
1313
// adds class "loaded" to the body
1414
// document.getElementsByTagName('body')[0].className+=' loaded';
1515

@@ -27,7 +27,7 @@ bannerInit = function(){
2727
anim();
2828
}
2929

30-
anim = function(){
30+
function anim(){
3131
console.log('animating');
3232

3333
// Example #1

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-buildabanner",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Yeoman generator to help build a variety of HTML banners: Standard, Adwords, DoubleClick Studio or Sizmek.",
55
"license": "MIT",
66
"main": "app/index.js",

0 commit comments

Comments
 (0)