From 2c9fe3a1a770de8f313f56a151c28256890c7583 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 18 Jun 2020 07:52:38 -0500 Subject: [PATCH] feat: humus --- .neutrinorc.client.js | 15 +++++++++++++-- .neutrinorc.server.js | 12 ++++++++++-- middleware.js | 5 ++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.neutrinorc.client.js b/.neutrinorc.client.js index d31d2be..d09790d 100644 --- a/.neutrinorc.client.js +++ b/.neutrinorc.client.js @@ -2,6 +2,7 @@ const path = require('path'); const react = require('@neutrinojs/react'); const styles = require('@neutrinojs/style-loader'); const globImporter = require('node-sass-glob-importer'); +const scwp = require('scwp/neutrino'); const {DefinePlugin} = require('webpack'); const {afterPlatform, initial} = require('./middleware'); @@ -13,7 +14,13 @@ module.exports = { use: [ initial({ environmentDefines: ['FRONTEND_ORIGIN'], - scwpPaths: [/^@avocado/], + rawScwpPaths: [ + `${__dirname}/../humus/src/common`, + `${__dirname}/../humus/src/server`, + ], + scwpPaths: [ + /^@avocado/, + ], }), react({ devServer: { @@ -47,7 +54,11 @@ module.exports = { }, }), afterPlatform({ - babelPaths: [/^@avocado/, /^contempo/, /^scwp/], + babelPaths: [ + /^@avocado/, + `${__dirname}/../humus/src/common`, + `${__dirname}/../humus/src/server`, + ], }), (neutrino) => { neutrino.config.module.rule('style') diff --git a/.neutrinorc.server.js b/.neutrinorc.server.js index 6049c94..29fe8ab 100644 --- a/.neutrinorc.server.js +++ b/.neutrinorc.server.js @@ -17,11 +17,19 @@ module.exports = { use: [ initial({ environmentDefines: ['REDIS_ORIGIN'], - scwpPaths: [/^@avocado/], + rawScwpPaths: [ + `${__dirname}/../humus/src/common`, + `${__dirname}/../humus/src/server`, + ], + scwpPaths: [ + /^@avocado/, + ], }), node(), afterPlatform({ - babelPaths: [/^@avocado/], + babelPaths: [ + /^@avocado/, + ], externalMatcher: /(?:@avocado|@pixi|scwp|webpack)/, }), (neutrino) => { diff --git a/middleware.js b/middleware.js index 54a3d7d..4a67864 100644 --- a/middleware.js +++ b/middleware.js @@ -35,6 +35,7 @@ const gatherPackagePaths = (root, packageMatchers) => { exports.initial = (options) => (neutrino) => { const { environmentDefines = [], + rawScwpPaths = [], scwpPaths = [], } = options; neutrino.options.mains.index = `${side}/index`; @@ -60,7 +61,9 @@ exports.initial = (options) => (neutrino) => { './src/common', `./src/${side}`, ].concat( - gatherPackagePaths(neutrino.options.root, scwpPaths.concat(/^scwp/)) + gatherPackagePaths(neutrino.options.root, scwpPaths.concat(/^scwp/)), + ).concat( + rawScwpPaths, ), })(neutrino); neutrino.config