Skip to content

Commit

Permalink
Update compile-es6.js
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo authored Feb 21, 2018
1 parent bd0e31c commit cdfaf69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/build-modules-js/compile-es6.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const glob = require('glob');
const fs = require('fs');
const babel = require('babel-core');
const os = require('os');

const pattern = './**/*.es6.js';
const options = {
Expand All @@ -23,7 +24,7 @@ OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.`;
babel.transformFile(filePath, babelOptions, (error, result) => {
if (error) process.exit(1);
const fileName = filePath.slice(0, -7);
fs.writeFile(`${fileName}.js`, result.code, (fsError) => {
fs.writeFile(`${fileName}.js`, result.code + os.EOL, (fsError) => {
if (fsError) process.exit(1);
});
});
Expand Down

0 comments on commit cdfaf69

Please sign in to comment.