qpa-client/packages/qpa/webpack.config.ts

76 lines
1.6 KiB
TypeScript
Raw Normal View History

2019-10-04 17:21:47 +02:00
import * as HtmlWebpackPlugin from "html-webpack-plugin"
2019-04-19 19:12:05 +02:00
import * as path from "path"
2019-08-03 17:25:41 +02:00
import * as webpack from "webpack"
2019-04-19 19:12:05 +02:00
const config: webpack.Configuration = {
2019-10-04 17:21:47 +02:00
entry: "./App/index.tsx",
2019-04-19 19:12:05 +02:00
resolve: {
2019-08-03 17:25:41 +02:00
extensions: [".js", ".jsx", ".ts", ".tsx"],
2019-04-19 19:12:05 +02:00
},
2019-05-25 10:36:18 +02:00
devServer: {
historyApiFallback: true,
hot: true,
2019-05-25 10:54:49 +02:00
proxy: {
2019-08-03 17:25:41 +02:00
"/graphql": {
2019-05-25 10:54:49 +02:00
redirect: false,
changeOrigin: true,
2019-10-03 11:47:57 +02:00
target: `https://alpha.quepasaalpujarra.com`,
2019-06-21 08:07:56 +02:00
},
2019-08-03 17:25:41 +02:00
"/api": {
2019-06-21 08:07:56 +02:00
redirect: false,
changeOrigin: true,
2019-10-03 11:47:57 +02:00
target: `https://alpha.quepasaalpujarra.com`,
2019-08-03 17:25:41 +02:00
},
2019-05-25 10:54:49 +02:00
2019-08-03 17:25:41 +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",
2019-08-03 17:25:41 +02:00
"@babel/react",
2019-08-16 10:30:29 +02:00
[
"@emotion/babel-preset-css-prop",
{
autoLabel: true,
labelFormat: "[local]",
},
],
2019-04-19 19:12:05 +02:00
],
2019-08-16 10:30:29 +02:00
plugins: [
"@babel/plugin-proposal-class-properties",
].filter(Boolean),
2019-08-03 17:25:41 +02:00
},
},
2019-08-16 10:50:14 +02:00
},
{
test: /\.(woff|woff2)$/i,
use: [
{
loader: "url-loader",
},
],
},
],
2019-04-19 19:12:05 +02:00
},
2019-08-03 17:25:41 +02:00
devtool: "@source-map",
2019-04-19 19:12:05 +02:00
output: {
2019-10-04 17:21:47 +02:00
path: path.resolve(__dirname, "../../dist/static"),
2019-08-03 17:25:41 +02:00
filename: "bundle.js",
publicPath: "/",
2019-04-19 19:12:05 +02:00
},
plugins: [new HtmlWebpackPlugin({
2019-10-04 17:21:47 +02:00
template: "./index-dev.html",
2019-08-03 17:25:41 +02:00
})],
2019-04-19 19:12:05 +02:00
}
export default config