-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
48 lines (48 loc) · 5.86 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
"name": "grunt-usemin",
"version": "0.1.12",
"description": "Grunt task replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views).",
"keywords": [
"gruntplugin",
"usemin",
"yeoman",
"html",
"css",
"optimize"
],
"homepage": "https://github.com/yeoman/grunt-usemin",
"bugs": {
"url": "https://github.com/yeoman/grunt-usemin/issues"
},
"author": {
"name": "Chrome Developer Relations"
},
"main": "Gruntfile.js",
"repository": {
"type": "git",
"url": "git://github.com/yeoman/grunt-usemin.git"
},
"scripts": {
"test": "grunt"
},
"devDependencies": {
"grunt": "~0.4.1",
"mocha": "~1.9.0",
"mkdirp": "~0.3.5",
"rimraf": "~2.1.4",
"grunt-contrib-jshint": "~0.4.1"
},
"peerDependencies": {
"grunt": "~0.4.0"
},
"engines": {
"node": ">=0.8.0"
},
"licenses": {
"type": "BSD"
},
"readme": "# grunt-usemin [![Build Status](https://secure.travis-ci.org/yeoman/grunt-usemin.png?branch=master)](http://travis-ci.org/yeoman/grunt-usemin)\n\n> Replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views).\n\nWatch out, this task is designed for Grunt 0.4 and upwards.\n\n## Getting Started\nIf you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:\n\n```shell\nnpm install grunt-usemin --save-dev\n```\n\n[grunt]: http://gruntjs.com/\n[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md\n\n## Workflow\n\nusemin is composed of 2 different tasks (`useminPrepare` and `usemin`) that are part of the same workflow:\n\n- **useminPrepare**: detects special construction (blocks) in the HTML files and update the `grunt` config to run `concat`/`uglify`/`cssmin`/`requirejs` on the files referenced in the block. It does not changes the HTML files it is working on.\n- **usemin**: in the HTML and CSS files it treats, it replaces the blocks by a reference to a single file, as well as all references to images, scripts, CSS files, by their minified/revved/.. version if it is found on the disk. As such this target rewrites the HTML and CSS files it is working on.\n\nUsually, `useminPrepare` is launched first, then the `concat`, `uglify`, `cssmin` and `requirejs` tasks are launched (they will created the minified/revved version of the referenced files), and then, in the end `usemin` is launched.\n\n## The useminPrepare task\n\nA special task which uses the build block HTML comments in markup to get back the list of files to handle, and initialize the grunt configuration appropriately, and automatically.\n\nCustom HTML \"block\" comments are provided as an API for interacting with the build script. These comments adhere to the following pattern:\n\n```html\n<!-- build:<type>(alternate search path) <path> -->\n... HTML Markup, list of script / link tags.\n<!-- endbuild -->\n```\n\n- **type**: either `js` or `css`\n- ** alternate search path **: (optional) By default the input files are relative to the treated file. Alternate search path allow to change that\n- **path**: the file path of the optimized file, the target output\n\nAn example of this in completed form can be seen below:\n\n```html\n<!-- build:js js/app.js -->\n<script src=\"js/app.js\"></script>\n<script src=\"js/controllers/thing-controller.js\"></script>\n<script src=\"js/models/thing-model.js\"></script>\n<script src=\"js/views/thing-view.js\"></script>\n<!-- endbuild -->\n```\n\nInternally, the task parses your HTML markup to find each of these blocks, and initializes for you the corresponding Grunt config for the concat / uglify tasks when `type=js`, the concat / cssmin tasks when `type=css`.\n\nThe task also handles use of RequireJS, for the scenario where you specify the main entry point for your application using the \"data-main\" attribute as follows:\n\n```html\n<!-- build:js js/app.min.js -->\n<script data-main=\"js/main\" src=\"js/vendor/require.js\"></script>\n<!-- -->\n```\n\nOne doesn't need to specify a concat/uglify/cssmin or RequireJS configuration anymore.\n\nIt is using only one target: `html`, with a list of the concerned files. For example, in your `Gruntfile.js`:\n\n```js\n'useminPrepare': {\n html: 'index.html'\n}\n```\n\n### Options\n\n#### uglify\nType: 'string'\nDefault: 'uglify'\n\nName of the tool used to uglify the JavaScript.\n\n#### cssmin\nType: 'string'\nDefault: 'cssmin'\n\nName of the tool used to minify the CSS.\n\n### dest\nType: 'string'\nDefault: nil\n\nBase directory where the transformed files should be output.\n\n## The usemin task\n\nThis task is responsible for replacing in HTML and CSS files, references to non-minified files with reference to their minified/revved version if they are found on the disk.\n\n```js\nusemin: {\n html: ['**/*.html'],\n css: ['**/*.css'],\n options: {\n dirs: ['temp', 'dist']\n }\n}\n```\n### dirs\nType: 'array of strings'\nDefault: nil\n\nUsed to limit the directories that will be looked for revved files when replacing reference. By default all subdirectories are looked at.\n\n### basedir\nType: 'string'\nDefault: nil\n\nChange the basedir that represent the location of the transformed file. For example, let's imagine you have someting like:\n\n```\n|\n+--- styles\n \\ main.css\n+--- views\n \\ index.html\n```\n\nBy default, if the file to be transformed is `index.html`, the images, scripts, ... referenced by this file will be considered are being in the `views` directory, whereas they must be linked to the `styles` directory.\n\n## License\n\n[BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google\n",
"readmeFilename": "README.md",
"_id": "grunt-usemin@0.1.12",
"_from": "grunt-usemin@~0.1.10"
}