1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-11 05:40:11 +02:00
copilot/spikes/graphs-fe/plotly/webpack.config.js

70 lines
1.5 KiB
JavaScript
Raw Normal View History

2016-11-03 13:37:18 +02:00
const webpack = require('webpack');
const path = require('path');
const config = {
debug: true,
2016-11-07 16:35:58 +02:00
devtool: 'source-map',
context: path.join(__dirname, './client'),
app: path.join(__dirname, './client/index.js'),
2016-11-03 13:37:18 +02:00
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'react-hot-loader/patch',
2016-11-07 16:35:58 +02:00
'./index.js'
2016-11-03 13:37:18 +02:00
],
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: [
2016-11-07 16:35:58 +02:00
path.join(__dirname, './client')
2016-11-03 13:37:18 +02:00
],
loaders: ['babel']
}, {
test: /\.json?$/,
exclude: /node_modules/,
include: [
2016-11-07 16:35:58 +02:00
path.join(__dirname, './client')
2016-11-03 13:37:18 +02:00
],
loaders: ['json']
}, {
test: /\.css$/,
exclude: /node_modules/,
include: [
2016-11-07 16:35:58 +02:00
path.join(__dirname, './client')
2016-11-03 13:37:18 +02:00
],
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);