UNPKG

@vagalumedigital/gatsby-plugin-mailchimp-api

Version:

A plugin written to use Mailchimp API v3 to add/update users subscribed on a list

27 lines (24 loc) 569 B
"use strict"; exports.onCreateWebpackConfig = ({ plugins, actions }, { id, key }) => { const isString = typeof id === 'string'; if (!isString) { throw new Error('Mailchimp list id and key are required and must be of type string. See repo README for more info.'); } actions.setWebpackConfig({ node: { fs: 'empty', net: 'empty', tls: 'empty' }, plugins: [plugins.define({ __GATSBY_PLUGIN_MAILCHIMP_API_LIST_ID__: JSON.stringify(id), __GATSBY_PLUGIN_MAILCHIMP_API_KEY__: JSON.stringify(key) })] }); };