From fbbc2907985bf882f25a1cfca86fe9f584a8446c Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Thu, 8 Mar 2018 21:13:19 +0000 Subject: [PATCH] Added JS to minifier --- .gitignore | 5 ++--- .travis.yml | 2 +- README.md | 2 +- package.json | 2 +- static/js/map.js | 5 +---- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 6bf20e9..7359959 100755 --- a/.gitignore +++ b/.gitignore @@ -13,9 +13,8 @@ config/env/* !config/env/sample.js !config/env/travis.js -# Minified or bundled static files (can be built with `npm run minify && npm run build`) -static/css/*.min.* -static/**/*.bun.* +# Minified static files +static/**/*.min.* # Ignore docs files _gh_pages diff --git a/.travis.yml b/.travis.yml index f16f28d..9b53886 100755 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ branches: before_script: - echo "module.exports = require('./travis.js')" > config/env/env.js script: - - npm run minify & npm run build + - npm run minify # Send coverage data to Coveralls after_script: diff --git a/README.md b/README.md index b1939dd..8504b83 100755 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Then edit `config/env/local-config.js` to match your local environment. Run Tracman with npm: ```sh -(npm run minify & npm run build) && npm start +npm run minify && npm start ``` ...or with [nodemon](https://nodemon.io/): diff --git a/package.json b/package.json index e14dc52..bddd5e3 100755 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "start": "node server.js", "nodemon": "nodemon --ignore 'static/**/*.min.*' server.js", "update": "sudo npm update && sudo npm prune", - "minify": "minify --template .{{filename}}.min.{{ext}} --clean static/css*" + "minify": "rm static/**/.*.min.* && minify --template .{{filename}}.min.{{ext}} --clean static/js ; minify --template .{{filename}}.min.{{ext}} --clean static/css" }, "repository": "Tracman-org/Server", "keywords": [ diff --git a/static/js/map.js b/static/js/map.js index a84f1c7..3fb0ad0 100755 --- a/static/js/map.js +++ b/static/js/map.js @@ -1,9 +1,6 @@ 'use strict' -/* global alert mapuser userid disp noHeader mapKey navigator token */ +/* global alert io $ loadGoogleMapsAPI mapuser userid disp noHeader mapKey navigator token */ -import io from 'socket.io-client' -import $ from 'jquery' -import loadGoogleMapsAPI from 'load-google-maps-api' // Variables var map, marker, elevator, newLoc