forked from EFFALO/domekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.js.erb
37 lines (34 loc) · 1.14 KB
/
demo.js.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<%
# Closure Compiler is run from a Script. To obtain
# the dynamically generated javascript from this file:
# http://localhost:8080/hello/compiler.js
# These are the same options as compiler.jar. Two exceptions:
# 1. No --compilation_level will load the original sources
# instead of using the compiler.jar default.
# 2. The --ns argument compiles a namespace. Closure Script simply
# turns these into --js arguments before calling the compiler.
args = %w{
--summary_detail_level 3
--ns domekit.Controller
--ns domekit.Demo
}
# You can make as many compiler Scripts as you like but
# it may be more convenient to accept options on the URL.
# http://localhost:8080/hello/compiler.js?build
# http://localhost:8080/hello/compiler.js?debug
args += case query_string
when 'build' then %w{
--compilation_level ADVANCED_OPTIMIZATIONS
--js_output_file compiler_build.js
--create_source_map compiler_build.map
}
when 'debug' then %w{
--debug true
--formatting PRETTY_PRINT
--compilation_level ADVANCED_OPTIMIZATIONS
--js_output_file compiler_debug.js
}
else;[];end
# Compile the javascript.
@response = goog.compile(args).to_response
%>