Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

build-plugin-main-fields

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-plugin-main-fields - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

20

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugin = ({ onGetWebpackConfig }) => {
function getValidOptions(options) {
if (options && typeof options === 'object' && 'mainFields' in options && Array.isArray(options.mainFields)) {
return {
mainFields: options.mainFields
};
}
return {
mainFields: ['main', 'module']
};
}
const plugin = ({ onGetWebpackConfig }, options) => {
onGetWebpackConfig(config => {
config.resolve.mainFields
.clear('.mjs').add('main').add('module');
const mainFields = getValidOptions(options).mainFields;
const chainable = config.resolve.mainFields
.clear('.mjs');
for (const field of mainFields) {
chainable.add(field);
}
});
};
exports.default = plugin;

2

package.json
{
"name": "build-plugin-main-fields",
"version": "1.0.0",
"version": "1.0.1",
"description": "Build-scripts plugin for config resolve fields of package.json",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc