humus-old/webpack.common.config.js

69 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-03-20 15:28:18 -05:00
const path = require('path');
const webpack = require('webpack');
const config = {
mode: 'development',
module: {
rules: [
{
test: /\.js$/,
exclude: [
2019-04-12 11:04:59 -05:00
/(node_modules\/(?!@avocado|contempo))/,
2019-03-20 15:28:18 -05:00
],
use: {
loader: 'babel-loader',
},
},
2019-04-14 21:32:48 -05:00
{
test: /register-packets\.js/,
use: {
loader: './defgen',
options: {
classTransformer: (Packet) => {
return `${Packet}Packet`;
},
paths: [
path.resolve(__dirname, 'common'),
],
registrar: {
function: 'registerPacket',
2019-04-24 18:02:13 -05:00
module: '@avocado/net',
2019-04-14 21:32:48 -05:00
},
type: 'packet',
},
},
},
2019-03-20 15:28:18 -05:00
{
2019-04-14 21:06:58 -05:00
test: /register-traits\.js/,
2019-04-14 20:39:27 -05:00
use: {
2019-04-14 21:06:58 -05:00
loader: './defgen',
2019-04-14 20:39:27 -05:00
options: {
paths: [
path.resolve(__dirname, 'common'),
],
2019-04-14 21:06:58 -05:00
registrar: {
function: 'registerTrait',
2019-04-14 21:32:48 -05:00
module: '@avocado/entity',
2019-04-14 21:06:58 -05:00
},
type: 'trait',
},
2019-04-14 20:39:27 -05:00
},
2019-03-20 15:28:18 -05:00
},
],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
2019-04-22 14:07:26 -05:00
plugins: [],
2019-03-20 15:28:18 -05:00
resolve: {
modules: [path.resolve(__dirname, 'node_modules')],
},
resolveLoader: {
modules: [path.resolve(__dirname, 'node_modules')],
},
};
module.exports = config;