/* Author: Seva Luchianov */
const _ = require('lodash');
const path = require('path');
const utils = require('./utils');
const Webpack = require('webpack');
const {
CleanWebpackPlugin
} = require('clean-webpack-plugin');
module.exports = function() {
return _.merge({}, require('./config.js'), {
output: {
path: path.resolve(__dirname, '../dist')
},
plugins: [
new Webpack.DefinePlugin({
'process.env': {
backgroundMessages: JSON.stringify(
utils.getEntriesInFolder(global.JS_ROOT + "websocket/messages").map(([, entry]) => entry.slice(0, -3))
)
}
}),
new CleanWebpackPlugin()
]
});
};