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

31 lines
840 B
JavaScript
Raw Permalink 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',
watch: true,
2021-02-16 08:43:26 +01:00
devServer: {
contentBase: path.join(__dirname, 'dist'),
port: 3000,
hot: true,
historyApiFallback: {
rewrites: [
{ from: /^\/c\//, to: '/index.html' }
]
}
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'public/index.html'),
templateParameters: {
PUBLIC_URL: process.env.PUBLIC_URL ? process.env.PUBLIC_URL : 'http://localhost:3000'
},
base: process.env.PUBLIC_URL ? process.env.PUBLIC_URL : 'http://localhost:3000'
})
]
});