Skip to content
Permalink
Browse files

Clean up assemble.js

Fix eslint violations, remove extra requires.
  • Loading branch information...
lautis committed Feb 10, 2016
1 parent 2281e3e commit fafeff51725222e8dc690b28f91d292be3965eec
Showing with 10 additions and 7 deletions.
  1. +4 −0 .eslintrc
  2. +6 −6 assemble.js
  3. +0 −1 package.json
@@ -20,5 +20,9 @@
"clearTimeout": true,
"setInterval": true,
"clearInterval": true
},
"env": {
"browser": true,
"node": true
}
}
@@ -4,17 +4,15 @@
* This file is responsible for building Bacon.js, Bacon.noAssert.js and Bacon.min.js
*/

/* eslint no-console: 0 */
"use strict";

var fs = require("fs");
var path = require("path");
var rollup = require("rollup").rollup;
var createFilter = require('rollup-pluginutils').createFilter;
var babelPlugin = require("rollup-plugin-babel");

var recast = require("recast");

var assert = require("assert");
var uglifyjs = require("uglify-js");
var esprima = require("esprima");
var estraverse = require("estraverse");
@@ -76,7 +74,7 @@ var main = function(options) {
function stripAsserts(code) {
var ast = esprima.parse(code, { sourceType: 'module' });
estraverse.replace(ast, {
enter: function (node, parent) {
enter: function (node) {
if (node !== null && node.type === "BlockStatement") {
node.body = node.body.filter(notAssertStatement);
return node;
@@ -86,7 +84,9 @@ var main = function(options) {
return escodegen.generate(ast);
}

try {fs.mkdirSync("dist")} catch (e) {}
try {fs.mkdirSync("dist")} catch (e) {
// directory exists, do nothing
}

var plugins = [babelPlugin()];
if (process.argv.length > 2) {
@@ -134,7 +134,7 @@ if (require.main === module) {
verbose: true,
output: defaultOutput,
noAssert: defaultNoAssert,
minified: defaultMinified,
minified: defaultMinified
});
}

@@ -80,7 +80,6 @@
"require-globify": "^1.3.0",
"rollup": "^0.25.3",
"rollup-plugin-babel": "^2.3.3",
"rollup-pluginutils": "^1.3.1",
"shelljs": "^0.5.3",
"sinon": "^1.12.2",
"uglify-js": "^2.4.16"

0 comments on commit fafeff5

Please sign in to comment.
You can’t perform that action at this time.