Socket
Socket
Sign inDemoInstall

build-script-plugin-preset

Package Overview
Dependencies
11
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    build-script-plugin-preset

ice防腐插件合集


Version published
Maintainers
1
Install size
159 kB
Created

Readme

Source

build-script-plugin-preset

防腐webpack插件和babel插件preset

1、下载依赖

   snpm i build-script-plugin-preset --save-dev

2、在build.json文件中使用该插件

  // example

  "plugins": [
    + [ 
    +   'build-script-plugin-preset',
    +   {
    +      "esModulePackages": ["@sto/*", "@stofe/*"],
    +      "ondemandPackages": ["lodash"],
    +      "mutexPackages": [["dayjs", "moment"]["xxx", "yyy", "zzz"]],
    +   },
    + ],
    ...
  ]

3、参数规则

参数名称TypeDefaultDescription
esModulePackages{Array<string>}[]需要检测是否是支持esModule模块输出的包。可以是单个包检测:eg:lodash;也可以集合下的包检测:eg:@babel/*表示检测@babel下所有的包进行检测
ondemandPackages{Array<string>}[]检测项目的源码中使用的包是不是通过按需加载来使用的,eg:lodash
mutexPackages{Array<Array<string>>}[]检测项目的源码中使用了相同功能的包,eg:["dayjs", "moment"]

二、使用注意

  • 在使用了该插件后,在本地开发中如果触发以上检测的包都会警告处理

  • 如果发布到生产中触发了规则,则会中断打包,需正确更改源码中包使用

Keywords

FAQs

Last updated on 13 Mar 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc