Skip to content

Breaking change to support ES6 modules

Compare
Choose a tag to compare
@taylorhakes taylorhakes released this 28 Dec 06:35
· 8 commits to master since this release

It is suggested to use ES6 syntax to import module for webpack or rollup.

import PromiseMock from 'promise-mock';

If you are still using require/commonjs with webpack or rollup, you must reference the default property.

const PromiseMock = require('promise-mock').default;

In node, you can use it like normal

const PromiseMock = require('promise-mock');

This is a weird quirk of supporting ES6 and commonjs modules.