PKP & OJS3 Minified JS

Supphachoke Suntiwichaya
1 min readMar 23, 2019

--

Environment

  • Ubuntu 16.04.6 LTS
  • OJS 3.1.0
  1. Install JRE8
apt install openjdk-8-jre
update-alternatives — config java

2. Install Closure Compiler

wget https://dl.google.com/closure-compiler/compiler-latest.zipunzip compiler-latest.zipcp closure-compiler-v20190301.jar ~/bin/compiler.jar

3. Install gjslint

lib/pkp/tools/travis/install-linter.sh

4. ติดตั้ง closure-linter

pip install https://github.com/google/closure-linter/zipball/master

5. patch closure-linter

/usr/local/lib/python2.7/dist-packages/closure_linter/errorrules.pychangeflags.DEFINE_integer(‘max_line_length’, 80, ‘Maximum line length allowed ‘
‘without warning.’, lower_bound=1)
toflags.DEFINE_integer(‘max_line_length’, 200, ‘Maximum line length allowed ‘
‘without warning.’, lower_bound=1)
/usr/local/lib/python2.7/dist-packages/closure_linter/error_fixer.pychangeif char_count > 80 and token.line_number in self._file_changed_lines:
print “WARNING: Line %d of %s is now longer than 80 characters.” % (
toif char_count > 200 and token.line_number in self._file_changed_lines:
print “WARNING: Line %d of %s is now longer than 200 characters.” % (
token.line_number, self._file_name)
6. Edit Config

5. Change config.inc.php

changeenable_minified = Offtoenable_minified = On

done!!

--

--

No responses yet