Skip to content

Commit

Permalink
Do not overwrite existing vars on export
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed Aug 23, 2014
1 parent 48ebcd4 commit 9039ac8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Packager {
options = this.options,
root = Path.dirname(this.file);

var out = this.options['export'] ? `/* exported ${this.options['export']} */\nthis.${this.options['export']} = ` : '';
var out = this.options['export'] ? `/* exported ${this.options['export']} */\nthis.${this.options['export']} = this.${this.options['export']} || ` : '';
out += '(function() {\n';
out += this.fileList.map(function(file) {
var compiler = modules[file];
Expand Down
2 changes: 1 addition & 1 deletion test/artifacts/packager/export.packager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* exported Global */
this.Global = (function() {
this.Global = this.Global || (function() {
// nested/foo.js
var __module1__ = (function() {
"use strict";
Expand Down

0 comments on commit 9039ac8

Please sign in to comment.