2016-09-11 21:54:31 +02:00
|
|
|
// docs: http://webpack.github.io/docs/configuration.html
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
2016-09-13 23:43:54 +02:00
|
|
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
2016-09-11 21:54:31 +02:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: [
|
|
|
|
'webpack-dev-server/client?http://localhost:3000',
|
|
|
|
'webpack/hot/only-dev-server',
|
|
|
|
'./src/index',
|
|
|
|
],
|
|
|
|
|
|
|
|
resolve: {
|
|
|
|
root: [path.join(__dirname, 'src')],
|
2016-09-12 18:46:33 +02:00
|
|
|
extensions: ['', '.scss', '.css', '.js', '.jsx', '.json'],
|
2016-09-11 21:54:31 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
filename: 'bundle.js',
|
|
|
|
publicPath: '/static/',
|
|
|
|
},
|
|
|
|
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
{
|
|
|
|
test: /\.jsx?$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
loaders: ['babel'],
|
|
|
|
include: path.join(__dirname, 'src'),
|
|
|
|
},
|
2016-09-12 18:46:33 +02:00
|
|
|
{
|
|
|
|
test: /(\.scss|\.css)$/,
|
2016-09-13 23:43:54 +02:00
|
|
|
loader: ExtractTextPlugin.extract('style',
|
|
|
|
'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass'),
|
2016-09-12 18:46:33 +02:00
|
|
|
},
|
2016-09-11 21:54:31 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
2016-09-12 18:46:33 +02:00
|
|
|
new ExtractTextPlugin('bundle.css', { allChunks: true }),
|
2016-09-11 21:54:31 +02:00
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
|
|
],
|
|
|
|
|
2016-09-12 18:46:33 +02:00
|
|
|
sassLoader: {
|
|
|
|
data: '@import "theme/_config.scss";',
|
2016-09-13 23:43:54 +02:00
|
|
|
includePaths: [path.resolve(__dirname, './src')],
|
2016-09-12 18:46:33 +02:00
|
|
|
},
|
|
|
|
|
2016-09-11 21:54:31 +02:00
|
|
|
devtool: 'source-map',
|
|
|
|
|
|
|
|
externals: {
|
|
|
|
// stuff not in node_modules can be resolved here.
|
|
|
|
},
|
|
|
|
|
2016-09-28 23:02:23 +02:00
|
|
|
devServer: {
|
|
|
|
proxy: {
|
|
|
|
'/features': {
|
2016-10-02 17:26:00 +02:00
|
|
|
target: 'http://localhost:4242',
|
2016-09-28 23:02:23 +02:00
|
|
|
secure: false,
|
|
|
|
},
|
2016-10-17 17:26:01 +02:00
|
|
|
'/strategies': {
|
|
|
|
target: 'http://localhost:4242',
|
|
|
|
secure: false,
|
|
|
|
},
|
|
|
|
'/archive': {
|
|
|
|
target: 'http://localhost:4242',
|
|
|
|
secure: false,
|
|
|
|
},
|
2016-09-28 23:02:23 +02:00
|
|
|
},
|
|
|
|
},
|
2016-09-11 21:54:31 +02:00
|
|
|
};
|