39 lines
889 B
JavaScript
39 lines
889 B
JavaScript
const {spawn} = require('child_process');
|
|
|
|
const copy = require('@neutrinojs/copy');
|
|
const node = require('@neutrinojs/node');
|
|
const {DefinePlugin} = require('webpack');
|
|
|
|
const {afterPlatform, initial} = require('./middleware');
|
|
|
|
if (!process.argv.find((arg) => arg === 'production')) {
|
|
spawn('docker', ['run', '-p', '11346:6379', 'redis'], {stdio: 'inherit'});
|
|
}
|
|
|
|
module.exports = {
|
|
options: {
|
|
root: __dirname,
|
|
},
|
|
use: [
|
|
initial({
|
|
environmentDefines: ['REDIS_ORIGIN'],
|
|
scwpPaths: [/^@avocado/],
|
|
}),
|
|
node(),
|
|
afterPlatform({
|
|
babelPaths: [/^@avocado/],
|
|
externalMatcher: /(?:@avocado|@pixi|scwp|webpack)/,
|
|
}),
|
|
(neutrino) => {
|
|
neutrino.config
|
|
.plugin('avocado-define')
|
|
.use(DefinePlugin, [
|
|
{
|
|
AVOCADO_CLIENT: false,
|
|
AVOCADO_SERVER: true,
|
|
},
|
|
]);
|
|
},
|
|
],
|
|
};
|