1.0.9 • Published 9 years ago

grunt-packitjs v1.0.9

Weekly downloads
34
License
-
Repository
github
Last release
9 years ago

grunt-packitjs

Build Status npm

This is a grunt plugin to make use of /packer/ by Dean Edwards to pack javaScript files efficiently.

Installation

If you use npm:

npm install grunt-packitjs

If you don't use npm, clone this repository or download the latest version using the GitHub repository Downloads link.

Usage

Basic packing and concatenating files with default options

	packit: {
		options: {
			attribution: true,
			base62: true,
			shrink: false
		},

		target: { //target
			options: {  //default options
				pack: true,
				banners: true,
				action: 'write',
				dest: './out/main.js'
			},
			files: [
				{
					cwd: './in',
					src: '*.js',
					expand: true,
					flatten: true
				}
			]
		}
	}

Options

attribution

Type: Boolean Default: true

Turn on or off attribution at the start of each dest file (as defined under target specific options below).

base62

Type: Boolean Default: true

You can specify if base 62 encoding is to be applied or not with a boolean value

shrink

Type: Boolean Default: false

You can specify if variable name shrinking is to be applied or not with a boolean value

Target-specific options

dest

Type: String Default: ./test.js

Single output file with full path relative to project directory. If not specified, default outputfile will be test.js at the root of project directory. Currently, packitjs is supporting output into a single file per target.

pack

Type: Boolean Default: false

Disabling this option simply combines the source files into dest, without any packing. If pack is enabled, then source files are packed individually based on base62 and shrink conditions, and combined into dest

banners

Type: Boolean Default: true

Banners are simple file names added as comments before the file content. If set to true, every file will have a banner before it, else there will simply be file content.

action

Type: String Default: write

Three types of actions are supported: 'write', 'append', and 'prepend'.

  • Write - creates a new file at dest or overwrite existing file dest and file will contain only the output from the specific target.
  • Append - reads an existing file dest and adds the output from the specific target to the end of file. Existing contents are retained.
  • Prepend - reads an existing file dest and adds the output from the specific target to the start of file. Existing contents are retained.
1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago