pax_global_header00006660000000000000000000000064130542110440014504gustar00rootroot0000000000000052 comment=ae5764b4f8c70249f65c0ed66a6652506424c687 exports-loader-0.6.4/000077500000000000000000000000001305421104400144635ustar00rootroot00000000000000exports-loader-0.6.4/.gitignore000066400000000000000000000000151305421104400164470ustar00rootroot00000000000000node_modules exports-loader-0.6.4/LICENSE000066400000000000000000000020571305421104400154740ustar00rootroot00000000000000Copyright JS Foundation and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. exports-loader-0.6.4/README.md000066400000000000000000000044511305421104400157460ustar00rootroot00000000000000[![npm][npm]][npm-url] [![deps][deps]][deps-url] [![chat][chat]][chat-url]

Exports Loader

Exports variables from inside the file by appending `exports[...] = ...` statements..

Install

```bash npm i exports-loader --save ```

Usage

``` javascript require("exports-loader?file,parse=helpers.parse!./file.js"); // adds below code the the file's source: // exports["file"] = file; // exports["parse"] = helpers.parse; require("exports-loader?file!./file.js"); // adds below code the the file's source: // module.exports = file; ``` [Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)

Maintainers


Juho Vepsäläinen

Joshua Wiens

Kees Kluskens

Sean Larkin
[npm]: https://img.shields.io/npm/v/exports-loader.svg [npm-url]: https://npmjs.com/package/exports-loader [deps]: https://david-dm.org/webpack-contrib/exports-loader.svg [deps-url]: https://david-dm.org/webpack-contrib/exports-loader [chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg [chat-url]: https://gitter.im/webpack/webpack exports-loader-0.6.4/index.js000066400000000000000000000023421305421104400161310ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var loaderUtils = require("loader-utils"); var SourceNode = require("source-map").SourceNode; var SourceMapConsumer = require("source-map").SourceMapConsumer; var FOOTER = "/*** EXPORTS FROM exports-loader ***/\n"; module.exports = function(content, sourceMap) { if(this.cacheable) this.cacheable(); var query = loaderUtils.getOptions(this) || {}; var exports = []; var keys = Object.keys(query); if(keys.length == 1 && typeof query[keys[0]] == "boolean") { exports.push("module.exports = " + keys[0] + ";"); } else { keys.forEach(function(name) { var mod = name; if(typeof query[name] == "string") { mod = query[name]; } exports.push("exports[" + JSON.stringify(name) + "] = (" + mod + ");"); }); } if(sourceMap) { var currentRequest = loaderUtils.getCurrentRequest(this); var node = SourceNode.fromStringWithSourceMap(content, new SourceMapConsumer(sourceMap)); node.add("\n\n" + FOOTER + exports.join("\n")); var result = node.toStringWithSourceMap({ file: currentRequest }); this.callback(null, result.code, result.map.toJSON()); return; } return content + "\n\n" + FOOTER + exports.join("\n"); } exports-loader-0.6.4/package.json000066400000000000000000000006361305421104400167560ustar00rootroot00000000000000{ "name": "exports-loader", "version": "0.6.4", "author": "Tobias Koppers @sokra", "description": "exports loader module for webpack", "dependencies": { "loader-utils": "^1.0.2", "source-map": "0.5.x" }, "repository": { "type": "git", "url": "git@github.com:webpack/exports-loader.git" }, "licenses": [ { "type": "MIT", "url": "http://www.opensource.org/licenses/mit-license.php" } ] }