Babel-plugin-rewire with Meteor: Cannot read property '__Rewire__' of undefined

I’m trying to use babel-plugin-require to stub a private function in an imported file.

publicFunction.js:

function privateFunction() {
    return 3;
}

export default function publicFunction() {
    return privateFunction();
}

my.test.js

import sinon from 'sinon';
import { publicFunction, __RewireAPI__ as ThingsRewireAPI } from './publicFunction';

...

describe('A file to test', () => {
    it('uses rewire', () => {
		console.log('BABEL_ENV', process.env.BABEL_ENV);
		const myStub = sinon.stub().returns(42);
		ThingsRewireAPI.__Rewire__('privateFunction', myStub);
		publicFunction();
                expect(barStub.calledOnce).to.be.true;
	});
});

Package.json:

  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-plugin-rewire": "^1.2.0"
  },
  "plugins": [
    "transform-export-extensions"
  ],
  "env": {
    "test": {
      "plugins": [
        "rewire"
      ]
    }
  }

test.sh:

TEST_WATCH=1
BABEL_ENV=test

export TEST_WATCH
export BABEL_ENV

meteor test --driver-package meteortesting:mocha

Meteor version:
METEOR@1.6.1

When I run test.sh I see an error:

TypeError: Cannot read property '__Rewire__' of undefined

It seems like the rewire plugin isn’t running at all. I’ve tried all sorts of variations and get nothing but errors.

Does anybody have any idea what I’ve missed in connecting babel-plugin-rewire to Meteor?

As it is I’m going to have to export private functions so as to mock them, which is not nice.