Sha256: 373b172d031bb5d9e4072df142977f1dad433f27900c0ffd97128cae0c0ced8a

Contents?: true

Size: 1.5 KB

Versions: 7

Compression:

Stored size: 1.5 KB

Contents

<%
# 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 myapp.hello
}

# 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

# This will process all .soy files into .js files.
# Be careful you don't make a file.soy to go with the
# file.js you just started, it will overwrite file.js.
# Touching any .soy file will trigger a recompile.
goog.soy_to_js %w{
  --cssHandlingScheme goog
  --shouldGenerateJsdoc
  --shouldProvideRequireSoyNamespaces
  --outputPathFormat {INPUT_DIRECTORY}{INPUT_FILE_NAME_NO_EXT}.js
  **/*.soy
}

# Compile the javascript.
@response = goog.compile(args).to_response
%>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
closure-1.5.6 scripts/hello/compiler.js.erb
closure-1.5.5 scripts/hello/compiler.js.erb
closure-1.5.4 scripts/hello/compiler.js.erb
closure-1.5.3 scripts/hello/compiler.js.erb
closure-1.5.2 scripts/hello/compiler.js.erb
closure-1.5.1 scripts/hello/compiler.js.erb
closure-1.5.0 scripts/hello/compiler.js.erb