Skip to content

Commit

Permalink
Fix babel@6 upgrade regression.
Browse files Browse the repository at this point in the history
The new module definitions no longer export the default as module.exports unless you use a custom plugin.
  • Loading branch information
dantman committed Jan 8, 2016
1 parent d3e3b04 commit fe7897c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"presets": ["es2015", "stage-2"]
"presets": ["es2015", "stage-2"],
"plugins": ["add-module-exports"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"devDependencies": {
"babel-cli": "^6.4.0",
"babel-core": "^6.4.0",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.3.13",
"babel-preset-stage-2": "^6.3.13",
"bluebird": "^3.1.1",
Expand Down
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ describe('cacheman', function () {
cache.clear(done);
});

it('should return a proper CommonJS module, not an ES6-only one', function() {
var mod = require('../node/index');
assert.equal(typeof(mod), 'function');
});

it('should have main methods', function () {
assert.ok(cache.set);
assert.ok(cache.get);
Expand Down

0 comments on commit fe7897c

Please sign in to comment.