diff --git a/gulpfile.helper.js b/gulpfile.helper.js index d853a7f3..4aba8686 100644 --- a/gulpfile.helper.js +++ b/gulpfile.helper.js @@ -10,7 +10,7 @@ module.exports = function (gulp, helperOptions) { var options = minimist(process.argv.slice(2), { string: ['modulename', 'export', 'name', 'port', 'testfiles', 'es6'], default: { - modulename: helperOptions.moduleName, + moduleName: helperOptions.moduleName, targetName: helperOptions.targetName, export: 'ignore', port: '8888', @@ -51,7 +51,8 @@ module.exports = function (gulp, helperOptions) { } return (browserify({ entries: files.distEs5, - debug: true + debug: true, + standalone: options.moduleName }).transform('babelify', babelOptions) .bundle() .pipe(source(options.targetName)) @@ -68,7 +69,8 @@ module.exports = function (gulp, helperOptions) { gulp.task('dist:es6', function () { return (browserify({ entries: files.dist, - debug: true + debug: true, + standalone: options.moduleName }).bundle() .pipe(source(options.targetName)) .pipe(buffer()) diff --git a/gulpfile.js b/gulpfile.js index b1dd3602..8751b7be 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,7 +51,7 @@ require('./gulpfile.helper.js')(gulp, { polyfills: [], entry: './src/y.js', targetName: 'y.js', - moduleName: 'yjs', + moduleName: 'Y', includeRuntime: true, specs: [ './src/Database.spec.js', diff --git a/src/y.js b/src/y.js index 13eb88f0..b72b56ab 100644 --- a/src/y.js +++ b/src/y.js @@ -233,8 +233,4 @@ class YConfig { return this.db.whenTransactionsFinished() }) } -} - -if (typeof window !== 'undefined') { - window.Y = Y -} +} \ No newline at end of file