wisemapping-frontend/packages/webapp/webpack.dev.js

37 lines
999 B
JavaScript
Raw Normal View History

2021-02-17 09:11:08 +01:00
/* eslint-disable no-undef */
2021-02-16 08:43:26 +01:00
const path = require('path');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = merge(common, {
mode: 'development',
devtool: 'source-map',
devServer: {
port: 3000,
hot: true,
2024-02-07 06:48:04 +01:00
proxy: {
'/api': {
target: {
host: "0.0.0.0",
protocol: 'http:',
port: 8080
},
},
},
2021-02-16 08:43:26 +01:00
historyApiFallback: {
2022-07-13 03:58:11 +02:00
rewrites: [{ from: /^\/c\//, to: '/index.html' }],
},
2021-02-16 08:43:26 +01:00
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'public/index.html'),
templateParameters: {
2022-07-13 03:58:11 +02:00
PUBLIC_URL: process.env.PUBLIC_URL ? process.env.PUBLIC_URL : 'http://localhost:3000',
2024-02-07 06:48:04 +01:00
CLIENT_TYPE: process.env.CLIENT_TYPE ? process.env.CLIENT_TYPE : 'mock'
2021-02-16 08:43:26 +01:00
},
2022-07-13 03:58:11 +02:00
base: process.env.PUBLIC_URL ? process.env.PUBLIC_URL : 'http://localhost:3000',
}),
],
2021-02-16 08:43:26 +01:00
});