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.