diff --git a/gulpfile.js b/gulpfile.js index 8842cf6..7c9c6fb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,10 +10,10 @@ const isparta = require('isparta'); const babelify = require('babelify'); const watchify = require('watchify'); const buffer = require('vinyl-buffer'); -const esperanto = require('esperanto'); const browserify = require('browserify'); const runSequence = require('run-sequence'); const source = require('vinyl-source-stream'); +const rollup = require( 'rollup' ); // Gather the library data from `package.json` const manifest = require('./package.json'); @@ -59,15 +59,19 @@ createLintTask('lint-test', ['test/**/*.js']); // Build two versions of the library gulp.task('build', ['lint-src', 'clean'], function(done) { - esperanto.bundle({ - base: 'src', - entry: config.entryFileName, + rollup.rollup({ + entry: 'src/' + config.entryFileName, }).then(function(bundle) { - var res = bundle.toUmd({ - // Don't worry about the fact that the source map is inlined at this step. - // `gulp-sourcemaps`, which comes next, will externalize them. - sourceMap: 'inline', - name: config.mainVarName + var res = bundle.generate({ + // use this instead of `toUmd` + format: 'umd', + + // this is equivalent to `strict: true` - + // optional, will be auto-detected + //exports: 'named', + + // `name` -> `moduleName` + moduleName: config.mainVarName, }); $.file(exportFileName + '.js', res.code, { src: true }) diff --git a/package.json b/package.json index 883bb2f..09874b2 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "isparta": "~3.0.3", "jquery": "^2.1.4", "mocha": "^2.1.0", + "rollup": "^0.21.0", "run-sequence": "^1.0.2", "sinon": "^1.12.2", "sinon-chai": "^2.7.0",