46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
const path = require('path');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
const config = require('./webpack.common.config');
|
|
|
|
config.entry = {
|
|
client: [
|
|
'@babel/polyfill',
|
|
path.join(__dirname, 'register-traits.js'),
|
|
'@avocado/behavior/item/initialize',
|
|
path.join(__dirname, 'client', 'index.js'),
|
|
],
|
|
};
|
|
config.devServer = {
|
|
compress: true,
|
|
contentBase: path.resolve(__dirname, 'resource'),
|
|
disableHostCheck: true,
|
|
headers: {
|
|
'Access-Control-Allow-Origin': '*',
|
|
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
|
|
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
|
|
},
|
|
host: '0.0.0.0',
|
|
overlay: true,
|
|
port: 8421,
|
|
proxy: {
|
|
'/avocado': {
|
|
target: 'http://localhost:8420',
|
|
ws: true,
|
|
},
|
|
},
|
|
stats: 'minimal',
|
|
watchContentBase: true,
|
|
};
|
|
config.devtool = 'eval-source-map';
|
|
config.node = {
|
|
fs: 'empty',
|
|
path: 'empty',
|
|
};
|
|
config.plugins.push(new HtmlWebpackPlugin({
|
|
template: path.resolve(__dirname, 'client', 'index.html'),
|
|
}));
|
|
|
|
module.exports = config;
|