feat: humus

This commit is contained in:
cha0s 2020-06-18 07:52:38 -05:00
parent c84caf601e
commit 2c9fe3a1a7
3 changed files with 27 additions and 5 deletions

View File

@ -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')

View File

@ -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) => {

View File

@ -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