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);