2019-04-19 19:12:05 +02:00
|
|
|
import * as webpack from 'webpack'
|
|
|
|
import * as path from "path"
|
|
|
|
import * as HtmlWebpackPlugin from 'html-webpack-plugin'
|
|
|
|
|
|
|
|
const config: webpack.Configuration = {
|
|
|
|
entry: './App/index.tsx',
|
|
|
|
resolve: {
|
|
|
|
extensions: [".js", ".jsx", ".ts", ".tsx"]
|
|
|
|
},
|
2019-05-25 10:36:18 +02:00
|
|
|
devServer: {
|
|
|
|
historyApiFallback: true,
|
|
|
|
hot: true,
|
2019-05-25 10:54:49 +02:00
|
|
|
proxy: {
|
|
|
|
'/graphql': {
|
|
|
|
redirect: false,
|
|
|
|
changeOrigin: true,
|
|
|
|
target: `http://localhost:4000`,
|
2019-06-21 08:07:56 +02:00
|
|
|
},
|
|
|
|
'/api': {
|
|
|
|
redirect: false,
|
|
|
|
changeOrigin: true,
|
|
|
|
target: `http://localhost:4000`,
|
2019-05-25 10:54:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2019-05-25 10:36:18 +02:00
|
|
|
},
|
2019-04-19 19:12:05 +02:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
exclude: path.resolve(__dirname, "node_modules"),
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: {
|
|
|
|
loader: "babel-loader",
|
|
|
|
options: {
|
|
|
|
presets: [
|
|
|
|
"@babel/typescript",
|
|
|
|
"@babel/react"
|
|
|
|
],
|
|
|
|
plugins: [].filter(Boolean)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} ]
|
|
|
|
},
|
2019-05-25 10:54:49 +02:00
|
|
|
devtool: '@source-map',
|
2019-04-19 19:12:05 +02:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, './dist'),
|
2019-06-05 14:21:43 +02:00
|
|
|
filename: 'bundle.js',
|
|
|
|
publicPath: '/'
|
2019-04-19 19:12:05 +02:00
|
|
|
},
|
|
|
|
plugins: [new HtmlWebpackPlugin({
|
|
|
|
title: "blabla",
|
|
|
|
})]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default config
|