diff --git a/package.json b/package.json index 18b72a9b..fda8dd61 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "rimraf": "^2.5.1", "rollup": "^0.26.0", "rollup-plugin-babel": "^2.4.0", + "rollup-plugin-memory": "^1.0.0", "sinon": "^1.17.4", "sinon-chai": "^2.8.0", "uglify-js": "^2.6.1" diff --git a/rollup.config.js b/rollup.config.js index 6481e878..a12930d3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,7 +1,13 @@ import babel from 'rollup-plugin-babel'; +import memory from 'rollup-plugin-memory'; export default { + exports: 'default', plugins: [ + memory({ + path: 'src/index', + contents: "export { default } from './index';" + }), babel({ babelrc: false, presets: ['es2015-rollup', 'stage-0', 'react'], diff --git a/test/dist.js b/test/dist.js index 29cbf5a9..46743c00 100644 --- a/test/dist.js +++ b/test/dist.js @@ -1,6 +1,7 @@ -import { Router, Link, route } from '../'; import { h } from 'preact'; import { expect } from 'chai'; +const router = require('../'); // eslint-disable-line +const { Router, Link, route } = router; /** @jsx h */ describe('dist', () => { @@ -8,6 +9,7 @@ describe('dist', () => { expect(Router).to.be.a('function'); expect(Link).to.be.a('function'); expect(route).to.be.a('function'); + expect(router).to.equal(Router); }); describe('Router', () => {