Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build.js #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var FILE_ENCODING = 'utf-8',
let FILE_ENCODING = 'utf-8',
SRC_DIR = 'dev/src',
DIST_DIR = 'dist',
DIST_NAME = 'crossroads.js',
Expand All @@ -8,7 +8,7 @@ var FILE_ENCODING = 'utf-8',
DIST_MIN_PATH = DIST_DIR +'/'+ DIST_MIN_NAME;


var _fs = require('fs'),
let _fs = require('fs'),
_path = require('path'),
_pkg = JSON.parse(readFile('package.json')),
_now = new Date(),
Expand All @@ -33,7 +33,7 @@ function purgeDeploy(){


function build(){
var wrapper = readFile(SRC_DIR + '/wrapper.js'),
let wrapper = readFile(SRC_DIR + '/wrapper.js'),
deploy = tmpl(wrapper, {
LICENSE : readFile(SRC_DIR + '/license.txt'),
INTRO_JS : readFile(SRC_DIR + '/intro.js'),
Expand Down Expand Up @@ -61,7 +61,7 @@ function tmpl(template, data, regexp){


function uglify(srcPath) {
var
let
uglyfyJS = require('uglify-js'),
jsp = uglyfyJS.parser,
pro = uglyfyJS.uglify,
Expand All @@ -75,7 +75,7 @@ function uglify(srcPath) {


function minify(){
var license = tmpl( readFile(SRC_DIR +'/license.txt'), _replacements );
let license = tmpl( readFile(SRC_DIR +'/license.txt'), _replacements );
// we add a leading/trailing ";" to avoid concat issues (#73)
_fs.writeFileSync(DIST_MIN_PATH, license +';'+ uglify(DIST_PATH) +';', FILE_ENCODING);
console.log(' '+ DIST_MIN_PATH +' built.');
Expand Down