Skip to content

Commit

Permalink
Pass babel options directly instead of defining in .babelrc
Browse files Browse the repository at this point in the history
  • Loading branch information
arnellebalane committed Feb 16, 2019
1 parent 79cd098 commit a08a254
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

7 changes: 6 additions & 1 deletion scripts/build-es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ const METHODS_OUTPUT_DIR = path.resolve(__dirname, '../es5/methods');
await rmrf(OUTPUT_DIR);
await mkdir(METHODS_OUTPUT_DIR);

const babelOptions = {
presets: ['@babel/preset-env'],
plugins: ['add-module-exports']
};

await Promise.all(transformMap.map(async ({input, output}) => {
// Transform source file to ES5
const {code} = await babel.transformFileAsync(input);
const {code} = await babel.transformFileAsync(input, babelOptions);

// Write transformed code to the output file
// NOTE: We are doing additional transformation on the transformed
Expand Down

0 comments on commit a08a254

Please sign in to comment.