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

father-build-universal

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

father-build-universal

Library build tool based on rollup, support customize configures, such as vue/eslint.

  • 1.21.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
increased by450%
Maintainers
1
Weekly downloads
 
Created
Source

father-build-universal

Extends

See our main repo for more information.

New Feature Options

hookRollupPluginOptions

可用于对 rollup 插件设置项进行自定义修改,实现特殊需求。

在构建中,需要在插件 replace 设置项中增加一些自定义替换内容,如该场景对应配置为:

export default {
  hookRollupPluginOptions: (pluginName, pluginOptions, environment) => {
    if (pluginName === 'replace') {
      pluginOptions = [{
        ...pluginOptions[0] || {},
        'process.env.BUILD_UNIX_TIME': Date.now(),
      }, ...pluginOptions.slice(1)];
    }
    return pluginOptions;
  },
}

hookRollupConfig

可用于对生成的 rollup 设置项进行自定义修改,实现特殊需求。

在构建中,需要在插件设置项 babel 前方插入 eslint 插件才能保证其正常工作,hookRollupConfig 允许你自定义修改最终的 rollup 设置项,如该场景对应配置为:

import eslint from '@rollup/plugin-eslint';

export default {
  hookRollupConfig: (rollupOptions, environment) => {
    return rollupOptions.map((rollupOption) => ({
      ...rollupOption,
      plugins: {
        eslint(),
        ...rollupOption.plugin,
      },
    }));
  },
}

FAQs

Package last updated on 17 Mar 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc