Skip to content

Instantly share code, notes, and snippets.

@mrmartineau mrmartineau/app.min.js
Last active Dec 15, 2015

Embed
What would you like to do?
Sublime Closure Compile Build Script. Use a batchfile or shell script to determine which files should be concatinated and minified, then reference that in your Sublime build script
/** //@ sourceMappingURL=app.min.js.map
*/
console.log('foo');console.log('bar');
@echo Batch
@echo Compile JS
cd js/compiled
java -jar path/to/compiler.jar ^
--compilation_level SIMPLE_OPTIMIZATIONS ^
--js relative/path/to/file1.js ^
--js relative/path/to/file2.js ^
--create_source_map app.min.js.map ^
--source_map_format=V3 ^
--js_output_file app.min.js
@echo Done compiling
#!/bin/bash
echo "Compile JS"
cd js/compiled
java -jar path/to/compiler.jar \
--compilation_level SIMPLE_OPTIMIZATIONS \
--js relative/path/to/file1.js \
--js relative/path/to/file2.js \
--create_source_map app.min.js.map \
--source_map_format=V3 \
--js_output_file app.min.js
echo "Done compiling"
{
"selector": "source.js",
"cmd": ["./JS-build.sh"],
// Assuming your Sublime Project file is saved within your project dir
// Change the working dir to shell/batch scripts
"working_dir": "${project_path}",
"file_regex": "^(.*):([0-9]+):() ERROR - (.*)",
"windows":
{
"cmd": ["JS-build.bat"]
}
}
/** @preserve //@ sourceMappingURL=_app.min.js.map
*/
console.log('foo');
console.log('bar');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.