From 0237cf5318047266c3760280b83849185f9ae51a Mon Sep 17 00:00:00 2001 From: cha0s Date: Wed, 23 Dec 2020 11:52:35 -0600 Subject: [PATCH] fix: external peers --- config/split-config.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/config/split-config.js b/config/split-config.js index 3f80721..212c72a 100644 --- a/config/split-config.js +++ b/config/split-config.js @@ -1,10 +1,9 @@ const react = require('@neutrinojs/react'); -const { library } = require('webpack'); const nodeExternals = require('webpack-node-externals'); const config = require('./.neutrinorc'); -module.exports = ({name, files}, clientMains) => { +module.exports = ({name, files, peerDependencies}, clientMains) => { const mains = files .filter((file) => file.match(/\.js$/)) .map((file) => file.slice(0, -3)) @@ -37,9 +36,11 @@ module.exports = ({name, files}, clientMains) => { .library(name) .libraryTarget('umd') .umdNamedDefine(true); - neutrino.config.externals({ - '@latus/core/virtual': '@latus/core/virtual', - }); + if (peerDependencies) { + neutrino.config.externals( + Object.keys(peerDependencies).reduce((r, path) => ({...r, [path]: path}), {}), + ); + } }; clientConfig.use.push((neutrino) => { neutrino.config.node.set('Buffer', true);