reddichat/app/.neutrinorc.js

96 lines
2.5 KiB
JavaScript
Raw Permalink Normal View History

2020-12-07 03:24:45 -06:00
require('dotenv/config');
2020-12-08 02:24:47 -06:00
const airbnb = require('@neutrinojs/airbnb');
2020-12-07 03:24:45 -06:00
const clean = require('@neutrinojs/clean');
2020-12-14 12:18:00 -06:00
const copy = require('@neutrinojs/copy');
2020-12-07 03:24:45 -06:00
const mocha = require('@neutrinojs/mocha');
const node = require('@neutrinojs/node');
const {EnvironmentPlugin} = require('webpack');
const nodeExternals = require('webpack-node-externals');
module.exports = {
options: {
root: __dirname,
},
use: [
2020-12-08 02:24:47 -06:00
airbnb({
2020-12-07 03:24:45 -06:00
eslint: {
cache: false,
baseConfig: require('./.eslint.defaults'),
},
}),
clean({
cleanOnceBeforeBuildPatterns: ['**/*.hot-update.*'],
}),
2020-12-14 12:18:00 -06:00
copy({
2020-12-17 02:38:32 -06:00
patterns: ['favicon.png'].map((path) => ({
from: `src/assets/${path}`,
to: 'http',
})).concat(['flakes.png'].map((path) => ({
2020-12-14 12:18:00 -06:00
from: `src/assets/${path}`,
2020-12-17 00:19:13 -06:00
to: 'http/assets',
2020-12-17 02:38:32 -06:00
}))),
2020-12-14 12:18:00 -06:00
}),
2020-12-07 03:24:45 -06:00
mocha(),
node(),
(neutrino) => {
2020-12-08 07:34:11 -06:00
[
'components',
'context',
'fonts',
'hooks',
'images',
'scss',
].forEach((path) => {
neutrino.config.resolve.alias
.set(path, `${neutrino.options.source}/react/${path}`);
});
2020-12-07 05:48:17 -06:00
if (process.env.LATUS_LINTING) {
return;
}
neutrino.config.module
.rule('compile')
.use('babel')
.get('options').plugins.push(
[
'babel-plugin-webpack-alias',
{
config: `${__dirname}/webpack.config.js`,
},
],
);
2020-12-07 03:24:45 -06:00
neutrino.config
.plugin('environment')
.use(EnvironmentPlugin, [{
SIDE: 'server',
}]);
neutrino.config
.entry('index')
.prepend('@latus/core/start');
if ('production' !== neutrino.config.get('mode')) {
neutrino.config
.entry('index')
.prepend('dotenv/config');
neutrino.config
.plugin('start-server')
.tap((args) => {
const options = args[0];
const inspectArg = process.argv.find((arg) => -1 !== arg.indexOf('--inspect'));
if (inspectArg) {
options.nodeArgs.push(inspectArg);
}
const profArg = process.argv.find((arg) => -1 !== arg.indexOf('--prof'));
if (profArg) {
options.nodeArgs.push(profArg);
}
2020-12-14 06:58:55 -06:00
options.nodeArgs.push('--experimental-repl-await');
2020-12-07 03:24:45 -06:00
return args;
});
}
neutrino.config
.externals(nodeExternals({
}));
},
],
};