Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transpile non-minified bundles (#97)
Fixes #96 Also targets ESM browsers for the ESM build, rather than ES5 browsers for the other builds.
- Loading branch information
1 parent
2c38313
commit fb49d23
Showing
4 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'tabbable': patch | ||
--- | ||
|
||
Fix #96: Transpile non-minified bundles for expected browser targets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,44 @@ | ||
/* eslint-env node */ | ||
|
||
const plugins = [ | ||
'@babel/plugin-proposal-nullish-coalescing-operator', | ||
'@babel/plugin-proposal-optional-chaining', | ||
]; | ||
|
||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
modules: false, | ||
loose: true, | ||
}, | ||
], | ||
], | ||
plugins: [ | ||
'@babel/plugin-proposal-nullish-coalescing-operator', | ||
'@babel/plugin-proposal-optional-chaining', | ||
], | ||
env: { | ||
es5: { | ||
// ES5 browsers for CJS and UMD builds | ||
presets: [ | ||
[ | ||
// NOTE: With no targets specified, @babel/preset-env will transform all | ||
// ECMAScript 2015+ code by default, which is the original preset prior | ||
// to upgrading to Babel 7 | ||
// @see https://babeljs.io/docs/en/babel-preset-env#targets | ||
'@babel/preset-env', | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
], | ||
plugins, | ||
}, | ||
esm: { | ||
// ESM browsers for ESM builds | ||
presets: [ | ||
[ | ||
// @see https://babeljs.io/docs/en/babel-preset-env#targets | ||
'@babel/preset-env', | ||
{ | ||
modules: false, // preserve ES modules | ||
loose: true, | ||
targets: { | ||
esmodules: true, | ||
}, | ||
}, | ||
], | ||
], | ||
plugins, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters