Skip to content

Commit

Permalink
build: remove babel-plugin-add-module-exports
Browse files Browse the repository at this point in the history
Since we have deprecated deep requires we no longer need the
module.exports from the individual v*.js files.

Since we now ship plain, non-babled deep require files on the top level
of the npm package for legacy CommonJS deep-require support we can
compensate for the lack of module.exports in there and instead simply
access the "default" export of the algorithm-specific modules.

This change was inspired by
webpack/webpack#7973 (comment)
  • Loading branch information
ctavan committed Apr 23, 2020
1 parent 499695b commit 4b65163
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 15 deletions.
1 change: 0 additions & 1 deletion .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
plugins: [],
env: {
commonjs: {
plugins: ['babel-plugin-add-module-exports'],
presets: [['@babel/preset-env', { targets: { node: '8' }, modules: 'commonjs' }]],
},
esmBrowser: {
Expand Down
9 changes: 0 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@wdio/static-server-service": "6.0.13",
"@wdio/sync": "6.0.15",
"babel-eslint": "10.1.0",
"babel-plugin-add-module-exports": "1.0.2",
"bundlewatch": "0.2.6",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.1",
Expand Down
2 changes: 1 addition & 1 deletion v1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const deprecate = require('./deprecate.js');

const v1 = require('./dist/v1.js');
const v1 = require('./dist/v1.js').default;

module.exports = deprecate(
v1,
Expand Down
2 changes: 1 addition & 1 deletion v3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const deprecate = require('./deprecate.js');

const v3 = require('./dist/v3.js');
const v3 = require('./dist/v3.js').default;

module.exports = deprecate(
v3,
Expand Down
2 changes: 1 addition & 1 deletion v4.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const deprecate = require('./deprecate.js');

const v4 = require('./dist/v4.js');
const v4 = require('./dist/v4.js').default;

module.exports = deprecate(
v4,
Expand Down
2 changes: 1 addition & 1 deletion v5.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const deprecate = require('./deprecate.js');

const v5 = require('./dist/v5.js');
const v5 = require('./dist/v5.js').default;

module.exports = deprecate(
v5,
Expand Down

0 comments on commit 4b65163

Please sign in to comment.