Skip to content

Commit

Permalink
Transpile the UMD bundle to ES5
Browse files Browse the repository at this point in the history
Ref. #24 and #26.
  • Loading branch information
janhommes authored and mathiasbynens committed Jul 9, 2019
1 parent 443d215 commit 5e757a2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .babelrc
@@ -0,0 +1,14 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": [
"last 2 versions"
]
}
}
]
]
}
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -3,9 +3,11 @@
"version": "2.0.5",
"repository": "GoogleChromeLabs/jsbi",
"devDependencies": {
"@babel/preset-env": "^7.5.2",
"eslint": "^5.4.0",
"eslint-config-google": "^0.9.1",
"rollup": "^0.65.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-babel-minify": "^6.0.0"
},
"main": "dist/jsbi-cjs.js",
Expand Down
16 changes: 14 additions & 2 deletions rollup.config.mjs
Expand Up @@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import babel from 'rollup-plugin-babel';
import pkg from './package.json';
import minify from 'rollup-plugin-babel-minify';

Expand All @@ -23,12 +24,23 @@ export default [
}),
],
output: [
// Create a browser-friendly UMD build.
{ name: 'JSBI', file: pkg.browser, format: 'umd' },
// Create a Node.js-friendly CommonJS build.
{ file: pkg.main, format: 'cjs' },
// Create a JavaScript module build, for bundlers.
{ file: pkg.module, format: 'es' },
],
},
{
input: 'jsbi.mjs',
plugins: [
babel(),
minify({
comments: false,
}),
],
output: [
// Create a browser-friendly UMD build.
{ name: 'JSBI', file: pkg.browser, format: 'umd' }
],
},
];

0 comments on commit 5e757a2

Please sign in to comment.