diff --git a/config/package/.neutrinorc.js b/config/package/.neutrinorc.js index 6ff62c9..9829d24 100644 --- a/config/package/.neutrinorc.js +++ b/config/package/.neutrinorc.js @@ -1,15 +1,6 @@ -const copy = require('@neutrinojs/copy'); - -const config = require('../../config/.neutrinorc'); +const splitConfig = require('../../config/split-config'); const pkg = require('./package.json'); -const mains = pkg.files - .filter((file) => file.match(/\.js$/)) - .map((file) => file.slice(0, -3)) - .reduce((r, file) => ({...r, [file]: file}), {}); +const clientMains = []; -config.options = { - mains, -}; - -module.exports = config; +module.exports = splitConfig(pkg, clientMains); diff --git a/config/webpack.config.js b/config/webpack.config.js index 54d98e8..94d2585 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -3,4 +3,6 @@ // Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); +const configOfConfigs = require(`${__dirname}/.neutrinorc`); +const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; +module.exports = configs.map((config) => neutrino(config).webpack());