diff --git a/index.js b/index.js index a19319a..479ba95 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -var assert = require('nanoassert') +import assert from 'nanoassert' var placeholder = { cancel: noop, @@ -11,9 +11,7 @@ var placeholder = { } } -module.exports = animate - -function animate (keyframes, timingProperties) { +export default function animate (keyframes, timingProperties) { assert.equal(typeof keyframes, 'object', 'nanoanimation: keyframes should be an array or an object') assert.ok(typeof timingProperties === 'object' || typeof timingProperties === 'number', 'nanoanimation: timingProperties should be type object or number') diff --git a/package.json b/package.json index 2989151..d4652d8 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,15 @@ "description": "Safety wrapper around the Web Animation API", "repository": "choojs/nanoanimation", "version": "2.1.0", + "source": "index.js", + "main": "dist/nanoanimation.js", + "module": "dist/nanoanimation.mjs", "scripts": { "deps": "dependency-check . && dependency-check . --extra --no-dev", "start": "node .", + "build": "microbundle -o dist -f cjs,es", + "prepublishOnly": "npm run build", + "pretest": "npm run build", "test": "standard && npm run deps" }, "dependencies": { @@ -13,6 +19,7 @@ }, "devDependencies": { "dependency-check": "^2.9.1", + "microbundle": "^0.6.0", "standard": "^10.0.3", "tape": "^4.8.0" },