2020-07-12 03:45:53 -05:00
|
|
|
const {join} = require('path');
|
|
|
|
const {spawn} = require('child_process');
|
|
|
|
|
|
|
|
const copy = require('@neutrinojs/copy');
|
|
|
|
const node = require('@neutrinojs/node');
|
|
|
|
const {DefinePlugin} = require('webpack');
|
|
|
|
|
|
|
|
const {afterPlatform, initial} = require('./middleware');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
options: {
|
|
|
|
root: __dirname,
|
|
|
|
},
|
|
|
|
use: [
|
|
|
|
initial({
|
|
|
|
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,
|
|
|
|
},
|
|
|
|
]);
|
2020-07-12 21:10:29 -05:00
|
|
|
if ('production' !== process.env.NODE_ENV) {
|
|
|
|
neutrino.config
|
|
|
|
.entry('index')
|
|
|
|
.prepend('dotenv/config');
|
|
|
|
}
|
2020-07-12 03:45:53 -05:00
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|