mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 22:20:06 +02:00
9d3903a1db
This is an initial implement that at the moment constructs the required SVG layout to be used by D3.
70 lines
1.5 KiB
JavaScript
70 lines
1.5 KiB
JavaScript
const webpack = require('webpack');
|
|
const path = require('path');
|
|
|
|
const config = {
|
|
debug: true,
|
|
devtool: 'source-map',
|
|
context: path.join(__dirname, './client'),
|
|
app: path.join(__dirname, './client/index.js'),
|
|
entry: [
|
|
'webpack-dev-server/client?http://localhost:8080',
|
|
'webpack/hot/only-dev-server',
|
|
'react-hot-loader/patch',
|
|
'./index.js'
|
|
],
|
|
output: {
|
|
path: path.join(__dirname, './static'),
|
|
publicPath: '/static/',
|
|
filename: 'bundle.js'
|
|
},
|
|
plugins: [
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new webpack.NoErrorsPlugin()
|
|
],
|
|
postcss: () => {
|
|
return [
|
|
require('postcss-modules-values'),
|
|
require('postcss-nested'),
|
|
require('autoprefixer')
|
|
];
|
|
},
|
|
module: {
|
|
loaders: [{
|
|
test: /js?$/,
|
|
exclude: /node_modules/,
|
|
include: [
|
|
path.join(__dirname, './client')
|
|
],
|
|
loaders: ['babel']
|
|
}, {
|
|
test: /\.json?$/,
|
|
exclude: /node_modules/,
|
|
include: [
|
|
path.join(__dirname, './client')
|
|
],
|
|
loaders: ['json']
|
|
}, {
|
|
test: /\.css$/,
|
|
exclude: /node_modules/,
|
|
include: [
|
|
path.join(__dirname, './client')
|
|
],
|
|
loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'
|
|
}]
|
|
}
|
|
};
|
|
|
|
const devServer = {
|
|
hot: true,
|
|
compress: true,
|
|
lazy: false,
|
|
publicPath: config.output.publicPath,
|
|
historyApiFallback: {
|
|
index: './static/index.html'
|
|
}
|
|
};
|
|
|
|
module.exports = Object.assign({
|
|
devServer
|
|
}, config);
|