From 26d36924a8cde607246ee11cb0fc8f76927d6958 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 24 Dec 2020 23:23:36 -0600 Subject: [PATCH] refactor: webpack config --- config/package/webpack.config.js | 7 +------ config/webpack.config.js | 8 -------- packages/core/webpack.config.js | 7 +------ packages/db/webpack.config.js | 7 +------ packages/governor/webpack.config.js | 7 +------ packages/http/src/build/webpack.config.js | 2 ++ packages/http/webpack.config.js | 7 +------ packages/react/webpack.config.js | 7 +------ packages/redis/webpack.config.js | 7 +------ packages/redux/webpack.config.js | 7 +------ packages/repl/webpack.config.js | 7 +------ packages/socket/webpack.config.js | 7 +------ packages/user/webpack.config.js | 7 +------ 13 files changed, 13 insertions(+), 74 deletions(-) delete mode 100644 config/webpack.config.js diff --git a/config/package/webpack.config.js b/config/package/webpack.config.js index 94d2585..1046c78 100644 --- a/config/package/webpack.config.js +++ b/config/package/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/config/webpack.config.js b/config/webpack.config.js deleted file mode 100644 index 94d2585..0000000 --- a/config/webpack.config.js +++ /dev/null @@ -1,8 +0,0 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. -const neutrino = require('neutrino'); - -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); diff --git a/packages/core/webpack.config.js b/packages/core/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/core/webpack.config.js +++ b/packages/core/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/db/webpack.config.js b/packages/db/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/db/webpack.config.js +++ b/packages/db/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/governor/webpack.config.js b/packages/governor/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/governor/webpack.config.js +++ b/packages/governor/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/http/src/build/webpack.config.js b/packages/http/src/build/webpack.config.js index a4b73a4..165f0c0 100644 --- a/packages/http/src/build/webpack.config.js +++ b/packages/http/src/build/webpack.config.js @@ -4,4 +4,6 @@ const neutrino = require('neutrino'); // eslint-disable-next-line import/no-dynamic-require +const neutrino = require('neutrino'); + module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/http/webpack.config.js b/packages/http/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/http/webpack.config.js +++ b/packages/http/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/react/webpack.config.js b/packages/react/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/react/webpack.config.js +++ b/packages/react/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/redis/webpack.config.js b/packages/redis/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/redis/webpack.config.js +++ b/packages/redis/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/redux/webpack.config.js b/packages/redux/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/redux/webpack.config.js +++ b/packages/redux/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/repl/webpack.config.js b/packages/repl/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/repl/webpack.config.js +++ b/packages/repl/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/socket/webpack.config.js b/packages/socket/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/socket/webpack.config.js +++ b/packages/socket/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack(); diff --git a/packages/user/webpack.config.js b/packages/user/webpack.config.js index 94d2585..1046c78 100644 --- a/packages/user/webpack.config.js +++ b/packages/user/webpack.config.js @@ -1,8 +1,3 @@ -// Whilst the configuration object can be modified here, the recommended way of making -// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. -// Neutrino's inspect feature can be used to view/export the generated configuration. const neutrino = require('neutrino'); -const configOfConfigs = require(`${__dirname}/.neutrinorc`); -const configs = Array.isArray(configOfConfigs) ? configOfConfigs : [configOfConfigs]; -module.exports = configs.map((config) => neutrino(config).webpack()); +module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack();