Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

Clean up build file

Julian Garnier8a7db0268420
diff --git a/build.js b/build.js
index 7c119b26..419e8076 100644
--- a/build.js
+++ b/build.js
@@ -1,22 +1,21 @@
const fs = require('fs');
const compile = require('google-closure-compiler-js').compile;
-console.info('Compiling... 😀');
+const fileIn = 'anime.js';
+const fileOut = 'anime.min.js';
-fs.unlink('anime.min.js', (err) => {
+console.info('Compiling... 😀');
- fs.readFile('anime.js', {encoding: 'utf-8'}, function(err, data) {
+fs.unlink(fileOut, (err) => {
+ fs.readFile(fileIn, {encoding: 'utf-8'}, function(err, data) {
if (err) throw err;
-
const flags = {
jsCode: [{src: data}],
languageIn: 'ES6',
languageOut: 'ES5'
};
-
const out = compile(flags);
-
- fs.writeFile('anime.min.js', out.compiledCode, function(err) {
+ fs.writeFile(fileOut, out.compiledCode, function(err) {
if (err) throw err;
console.info('Compilation was a success! 😎 🍺');
});