diff --git a/babel.config.js b/babel.config.js index 044c191..7119f5d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -4,6 +4,7 @@ module.exports = { '@babel/preset-env', { loose: true, + modules: process.env.BABEL_ENV === 'test' ? 'commonjs' : 'auto', targets: { node: 'current', }, diff --git a/package.json b/package.json index 120a734..c6420b6 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "prepare": "npm run -s build", "prepare:babel": "babel src/*.js -d dist && npm t", "lint": "eslint src", - "test": "npm run -s lint && npm run -s build && jest", + "test": "npm run -s lint && npm run -s build && BABEL_ENV=test jest", "release": "npm run -s prepare && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" }, "repository": "developit/microbundle", diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 4ecac6b..3b5d26c 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -77,12 +77,12 @@ basic-json Build \\"basicJson\\" to dist: -146 B: basic-json.js.gz -97 B: basic-json.js.br -145 B: basic-json.mjs.gz -98 B: basic-json.mjs.br -225 B: basic-json.umd.js.gz -161 B: basic-json.umd.js.br" +130 B: basic-json.js.gz +81 B: basic-json.js.br +129 B: basic-json.mjs.gz +81 B: basic-json.mjs.br +209 B: basic-json.umd.js.gz +149 B: basic-json.umd.js.br" `; exports[`fixtures basic-ts 1`] = `