Last active
December 15, 2015 11:29
-
-
Save mrmartineau/5253200 to your computer and use it in GitHub Desktop.
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** //@ sourceMappingURL=app.min.js.map | |
*/ | |
console.log('foo');console.log('bar'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"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"] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @preserve //@ sourceMappingURL=_app.min.js.map | |
*/ | |
console.log('foo'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('bar'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment