Spec-Zone.ru › webpack 4

exports-loader

модуль загрузчика exports для webpack

Требования

Для этого модуля требуется минимум Node v6.9.0 и Webpack v4.0.0.

Начало работы

Для начала вам нужно установить exports-loader:

$ npm install exports-loader --save-dev

Затем добавьте загрузчик в необходимые require вызовы. Например:

require('exports-loader?file,parse=helpers.parse!./file.js');
// adds the following code to the file's source:
//  exports['file'] = file;
//  exports['parse'] = helpers.parse;

require('exports-loader?file!./file.js');
// adds the following code to the file's source:
//  module.exports = file;

require('exports-loader?[name]!./file.js');
// adds the following code to the file's source:
//  module.exports = file;

И запустите webpack выбранным вами способом.

Вклад

Пожалуйста, посмотрите наши руководящие принципы по внесению вклада, если вы этого еще не сделали.

ВКЛАД

Лицензия

MIT

© JS Foundation and other contributors
Licensed under the Creative Commons Attribution License 4.0.
https://v4.webpack.js.org/loaders/exports-loader

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API