1.0.0 • Published 2 years ago

@builder/exports-field-webpack-plugin v1.0.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
2 years ago

Exports Field webpack plugin

Support package-exports in webpack4.

Install

$ npm install @builder/exports-field-webpack-plugin

Usage

You can use it with webpack chain as:

const ExportsFieldWebpackPlugin = require('@builder/exports-field-webpack-plugin').default;

config.plugin('ExportsFieldWebpackPlugin').use(ExportsFieldWebpackPlugin, [
  {
    conditionNames: ['web'],
  },
]);

it will only load module with web condition path which define in module's package.json exports field.

Appreciation

This plugin is inspired by enhanced-resolve that creates webpack resolver.