motion
Version:
motion - moving development forward
65 lines (64 loc) • 4.19 kB
JSON
{
"_args": [
[
"file-loader@https://registry.npmjs.org/file-loader/-/file-loader-0.8.5.tgz",
"/Users/nw/flint/packages/flint"
]
],
"_from": "file-loader@0.8.5",
"_id": "file-loader@0.8.5",
"_inCache": true,
"_location": "/file-loader",
"_phantomChildren": {},
"_requested": {
"name": "file-loader",
"raw": "file-loader@https://registry.npmjs.org/file-loader/-/file-loader-0.8.5.tgz",
"rawSpec": "https://registry.npmjs.org/file-loader/-/file-loader-0.8.5.tgz",
"scope": null,
"spec": "https://registry.npmjs.org/file-loader/-/file-loader-0.8.5.tgz",
"type": "remote"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/file-loader/-/file-loader-0.8.5.tgz",
"_shasum": "9275d031fe780f27d47f5f4af02bd43713cc151b",
"_shrinkwrap": null,
"_spec": "file-loader@https://registry.npmjs.org/file-loader/-/file-loader-0.8.5.tgz",
"_where": "/Users/nw/flint/packages/flint",
"author": {
"name": "Tobias Koppers @sokra"
},
"bugs": {
"url": "https://github.com/webpack/file-loader/issues"
},
"dependencies": {
"loader-utils": "~0.2.5"
},
"description": "file loader module for webpack",
"devDependencies": {
"mocha": "~1.21.3",
"should": "~4.0.4"
},
"directories": {
"test": "test"
},
"files": [
"index.js"
],
"homepage": "https://github.com/webpack/file-loader",
"license": "MIT",
"main": "index.js",
"name": "file-loader",
"optionalDependencies": {},
"readme": "# file loader for webpack\r\n\r\n## Usage\r\n\r\n[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)\r\n\r\n``` javascript\r\nvar url = require(\"file!./file.png\");\r\n// => emits file.png as file in the output directory and returns the public url\r\n// => returns i. e. \"/public-path/0dcbbaa701328a3c262cfd45869e351f.png\"\r\n```\r\n\r\nBy default the filename of the resulting file is the MD5 hash of the file's contents \r\nwith the original extension of the required resource.\r\n\r\n## Filename templates\r\n\r\nYou can configure a custom filename template for your file using the query\r\nparameter `name`. For instance, to copy a file from your `context` directory\r\ninto the output directory retaining the full directory structure, you might\r\nuse `?name=[path][name].[ext]`.\r\n\r\n### Filename template placeholders\r\n\r\n* `[ext]` the extension of the resource\r\n* `[name]` the basename of the resource\r\n* `[path]` the path of the resource relative to the `context` query parameter or option.\r\n* `[hash]` the hash or the content\r\n* `[<hashType>:hash:<digestType>:<length>]` optionally you can configure\r\n * other `hashType`s, i. e. `sha1`, `md5`, `sha256`, `sha512`\r\n * other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`\r\n * and `length` the length in chars\r\n* `[N]` the N-th match obtained from matching the current file name against the query param `regExp`\r\n\r\n## Examples\r\n\r\n``` javascript\r\nrequire(\"file?name=js/[hash].script.[ext]!./javascript.js\");\r\n// => js/0dcbbaa701328a3c262cfd45869e351f.script.js\r\n\r\nrequire(\"file?name=html-[hash:6].html!./page.html\");\r\n// => html-109fa8.html\r\n\r\nrequire(\"file?name=[hash]!./flash.txt\");\r\n// => c31e9820c001c9c4a86bce33ce43b679\r\n\r\nrequire(\"file?name=[sha512:hash:base64:7].[ext]!./image.png\");\r\n// => gdyb21L.png\r\n// use sha512 hash instead of md5 and with only 7 chars of base64\r\n\r\nrequire(\"file?name=img-[sha512:hash:base64:7].[ext]!./image.jpg\");\r\n// => img-VqzT5ZC.jpg\r\n// use custom name, sha512 hash instead of md5 and with only 7 chars of base64\r\n\r\nrequire(\"file?name=picture.png!./myself.png\");\r\n// => picture.png\r\n\r\nrequire(\"file?name=[path][name].[ext]?[hash]!./dir/file.png\")\r\n// => dir/file.png?e43b20c069c4a01867c31e98cbce33c9\r\n```\r\n\r\n## License\r\n\r\nMIT (http://www.opensource.org/licenses/mit-license.php)\r\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/webpack/file-loader.git"
},
"scripts": {
"test": "mocha -R spec"
},
"version": "0.8.5"
}