Skip to content

Commit

Permalink
Build: Replace Esperanto with Rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
bethge authored and scottgonzalez committed May 5, 2016
1 parent f075fb7 commit 82df764
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 38 deletions.
22 changes: 9 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,26 @@ module.exports = function(grunt) {
});

grunt.registerTask('build', function() {
var esperanto = require('esperanto');
var rollup = require('rollup');
var done = this.async();

grunt.log.write('Building PEP...');
esperanto.bundle({
base: 'src',
entry: 'pointerevents.js'
rollup.rollup({
entry: 'src/pointerevents.js'
}).then(function(bundle) {
var umd = bundle.toUmd({
name: 'PointerEventsPolyfill'

// sourceMap: true,
// sourceMapFile: 'dist/pep.js'
var result = bundle.generate({
moduleName: 'PointerEventsPolyfill',
format: 'umd',
banner: header
});
grunt.file.write('dist/pep.js', header + umd.code);

// grunt.file.write('dist/pep.js.map', umd.map.toString());
grunt.file.write('dist/pep.js', result.code);
}).then(
function() {
grunt.log.ok();
done();
},
function(error) {
grunt.log.error();
grunt.log.error(error);
done(error);
}
);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"atob": "^1.1.2",
"bluebird": "^2.9.30",
"chai-spies": "^0.5.1",
"esperanto": "^0.6.6",
"fs-extra": "^0.19.0",
"glob": "^5.0.10",
"grunt": "~0.4.1",
Expand All @@ -34,7 +33,8 @@
"grunt-selenium-standalone": "1.0.1",
"intern": "2.2.2",
"lodash": "^3.9.3",
"request": "^2.58.0"
"request": "^2.58.0",
"rollup": "^0.26.1"
},
"web-platform-tests": {
"repo": "w3c/web-platform-tests#c98d1ff0ea91ba1aa9a15e8ea2d70d8ede1fdc0e",
Expand Down
2 changes: 1 addition & 1 deletion src/capture.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dispatcher from 'dispatcher';
import dispatcher from './dispatcher';

var n = window.navigator;
var s, r;
Expand Down
4 changes: 2 additions & 2 deletions src/dispatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PointerEvent from 'PointerEvent';
import PointerMap from 'pointermap';
import PointerEvent from './PointerEvent';
import PointerMap from './pointermap';

var CLONE_PROPS = [

Expand Down
2 changes: 1 addition & 1 deletion src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* All nodes that wish to generate Pointer Events must have the attribute
* `touch-action` set to `none`.
*/
import targeting from 'targeting';
import targeting from './targeting';

var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
var map = Array.prototype.map.call.bind(Array.prototype.map);
Expand Down
2 changes: 1 addition & 1 deletion src/mouse.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dispatcher from 'dispatcher';
import dispatcher from './dispatcher';

var pointermap = dispatcher.pointermap;

Expand Down
2 changes: 1 addition & 1 deletion src/ms.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dispatcher from 'dispatcher';
import dispatcher from './dispatcher';

var pointermap = dispatcher.pointermap;
var HAS_BITMAP_TYPE = window.MSPointerEvent &&
Expand Down
10 changes: 5 additions & 5 deletions src/platform-events.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import PointerEvent from 'PointerEvent';
import dispatcher from 'dispatcher';
import mouseEvents from 'mouse';
import touchEvents from 'touch';
import msEvents from 'ms';
import PointerEvent from './PointerEvent';
import dispatcher from './dispatcher';
import mouseEvents from './mouse';
import touchEvents from './touch';
import msEvents from './ms';

export function applyPolyfill() {

Expand Down
16 changes: 8 additions & 8 deletions src/pointerevents.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import dispatcher from 'dispatcher';
import PointerMap from 'pointermap';
import Installer from 'installer';
import targeting from 'targeting';
import PointerEvent from 'PointerEvent';
import { applyAttributeStyles } from 'touch-action';
import { applyPolyfill as applyPointerEventPolyfill } from 'platform-events';
import { applyPolyfill as applyCapturePolyfill } from 'capture';
import dispatcher from './dispatcher';
import PointerMap from './pointermap';
import Installer from './installer';
import targeting from './targeting';
import PointerEvent from './PointerEvent';
import { applyAttributeStyles } from './touch-action';
import { applyPolyfill as applyPointerEventPolyfill } from './platform-events';
import { applyPolyfill as applyCapturePolyfill } from './capture';

applyAttributeStyles();
applyPointerEventPolyfill();
Expand Down
8 changes: 4 additions & 4 deletions src/touch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import targeting from 'targeting';
import dispatcher from 'dispatcher';
import Installer from 'installer';
import mouseEvents from 'mouse';
import targeting from './targeting';
import dispatcher from './dispatcher';
import Installer from './installer';
import mouseEvents from './mouse';

var captureInfo = dispatcher.captureInfo;
var findTarget = targeting.findTarget.bind(targeting);
Expand Down

0 comments on commit 82df764

Please sign in to comment.