npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-google-closure-tools-compiler

v0.1.7

Published

Another Grunt task for Google Closure Compiler. Uses compiler npm build or you can use your own (eg: nightly builds)

Downloads

4

Readme

grunt-google-closure-tools-compiler Flattr this git repo Bountysource

npm version dependencies Build Status Coverage Status Stories in Ready Built with Grunt

Another Grunt task for Google Closure Compiler. Uses compiler npm build or you can use your own (eg: nightly builds)

(Table of contents generated by [verb])

Getting Started

This plugin requires Grunt >= 0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

Install with npm

$ npm install grunt-google-closure-tools-compiler --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-google-closure-tools-compiler');

closurecompiler task

Run this task with the grunt closurecompiler command.

This task requires that you have the closure compiler jar file anywhere on your building machine. However, this plugin loads the npm closure compiler.jar and set it as default compiler. You still can use a custom or another build from closure to set a new path to the jar file you want.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

closure_compilation_level

Choices: 'SIMPLE', 'ADVANCED' , 'WHITESPACE_ONLY' Default: 'SIMPLE'

Choose which closure compilation level we should use.

closure_create_source_map

Type: Boolean Default: true

If true, a source map file will be generated in the same directory as the dest file. By default it will have the same basename as the dest file, but with a .map extension.

closure_language_in

Choices: 'ECMASCRIPT3', 'ECMASCRIPT5' , 'ECMASCRIPT5_STRICT', 'ECMASCRIPT6', 'ECMASCRIPT6_STRICT', 'ECMASCRIPT6_TYPED' Default: 'ECMASCRIPT3' (null)

closure_language_out

Choices: 'ECMASCRIPT3', 'ECMASCRIPT5' , 'ECMASCRIPT5_STRICT', 'ECMASCRIPT6_TYPED' Default: language in

closure_formatting

Choices: 'PRETTY_PRINT', 'PRINT_INPUT_DELIMITER' , 'SINGLE_QUOTES' Default: 'PRETTY_PRINT' (null)

debug

Type: Boolean Default: true

Turn on closure compiler debug parameter.

closure_extra_param

Type: String Default: null

Set some custom parameters for closure execution.

banner

Type: String Default: ''

Put a string at the top of the compiled files.

compiler_jar

Type: String Default: 'node_modules/google-closure-compiler/compiler.jar'

Path to the compiler.jar file. This could be relative beginning from the google-closure-compiler directory or absolute like '/opt/closure-compiler/compiler.jar'.

exec_maxBuffer

Type: Integer Default: 0

Set maxBuffer if you got message "Error: maxBuffer exceeded."

java_path

Type: String Default: null

We use this path if it is setted. NOTE: If it is null we can also set the JAVA_HOME environment variable

java_d32

Type: Boolean Default: false

If this is true, the jar file will be executed with -client and -d32 java parameters.

java_tieredcompilation

Type: Boolean Default: true

If this is true, the jar file will be executed with -server and -XX:+TieredCompilation java parameters.

Usage Examples

Basic compression

// Project configuration.
grunt.initConfig({
  googleclosurecompiler: {
    my_target: {
      files: {
        'dest/output.min.js': ['src/input1.js', 'src/input2.js']
      }
    }
  }
});

Advanced compilation

// Project configuration.
grunt.initConfig({
  googleclosurecompiler: {
    my_target: {
      options: {
        closure_compilation_level: 'ADVANCED',
        banner: '/*\n' +
                ' * Minified by closure compiler \n' +
                ' */\n'
      },
      files: {
        'dest/output.min.js': ['src/*.js']
      }
    }
  }
});

All files with all subdirectories

// Project configuration.
grunt.initConfig({
  googleclosurecompiler: {
    my_target: {
      options: {
        closure_compilation_level: 'WHITESPACE_ONLY'
      },
      files: {
        'dest/output.min.js': ['src/**']
      }
    }
  }
});

Release History

0.1.7 (2015-12-21)

Bug Fixes
  • task: Add lodash for isUndefined condition instead of grunt.util.kindOf (eccecfb)

0.1.6 (2015-12-20)

Bug Fixes
  • task: Updating closure dependencies (e1cc166)

0.1.5 (2015-12-20)

Bug Fixes
  • package: Move google closure library from dev to normal dependencies (24450ab)
  • task: compile js files and put them into the same directory (f048611)
Features
  • task: Add custom extra parameters config for closure (a89fd1f)
  • task: Add formatting parameter (c8b85c9)
  • task: Add language-in and language-out options (a71416f)

0.1.4 (2015-12-18)

Features
  • task: Show input and output file size after compilation (fe369ae)

0.1.3 (2015-12-18)

Bug Fixes
  • bump: Fixing peerDependencies reference inside readme (da7553e)

0.1.2 (2015-12-18)

Bug Fixes
  • task: Catch error if files object is empty or dest file has an empty array (bd37307)
  • travis-ci: Removing npm uninstall grunt (1959803)
Features
  • task: Add JAVA_HOME and option.java_path to set the java binary path (2c24e70)

0.1.1 (2015-12-17)

0.1.0 (2015-12-17)

ToDo

Some stuff we have to do...

  • Write unit tests
  • Make closure externs possible
  • Support "--js closure-library/closure/goog/deps.js" https://github.com/thanpolas/grunt-closure-tools/issues/64
    • google-closure-library
  • Enhancement: change compilation levels for certain files. https://github.com/gmarty/grunt-closure-compiler/issues/13
  • Enable log file

Author

CSoellinger

License

Copyright © 2015 CSoellinger Released under the MIT license.


This file was generated by verb-cli on December 21, 2015.