exports-loader

[![npm][npm]][npm-url] [![node][node]][node-url] [![deps][deps]][deps-url] [![tests][tests]][tests-url] [![chat][chat]][chat-url]

exports loader module for webpack

Requirements

This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.

Getting Started

To begin, you’ll need to install exports-loader:

  1. $ npm install exports-loader --save-dev

Then add the loader to the desired require calls. For example:

  1. require('exports-loader?file,parse=helpers.parse!./file.js');
  2. // adds the following code to the file's source:
  3. // exports['file'] = file;
  4. // exports['parse'] = helpers.parse;
  5. require('exports-loader?file!./file.js');
  6. // adds the following code to the file's source:
  7. // module.exports = file;
  8. require('exports-loader?[name]!./file.js');
  9. // adds the following code to the file's source:
  10. // module.exports = file;

And run webpack via your preferred method.

Contributing

Please take a moment to read our contributing guidelines if you haven’t yet done so.

CONTRIBUTING CONTRIBUTING” class=”icon-link” href=”#contributing”>

License

MIT MIT” class=”icon-link” href=”#mit”>